63
63
@ EnableConfigurationProperties (ArtifactoryProperties .class )
64
64
class ArtifactoryServiceTests {
65
65
66
- private static final Duration SHORT_TIMEOUT = Duration .ofMinutes (2 );
67
-
68
- private static final Duration LONG_TIMEOUT = Duration .ofMinutes (60 );
66
+ private static final Duration TIMEOUT = Duration .ofMinutes (60 );
69
67
70
68
@ Autowired
71
69
private ArtifactoryService service ;
@@ -141,8 +139,8 @@ void promoteWhenPromotionFails() {
141
139
@ SuppressWarnings ("unchecked" )
142
140
void distributeWhenSuccessful () throws Exception {
143
141
ReleaseInfo releaseInfo = getReleaseInfo ();
144
- given (this .bintrayService .isDistributionComplete (eq (releaseInfo ), ( Set < String >) any (), any ())) .willReturn (false ,
145
- true );
142
+ given (this .bintrayService .isDistributionStarted (eq (releaseInfo ))) .willReturn (false );
143
+ given ( this . bintrayService . isDistributionComplete ( eq ( releaseInfo ), ( Set < String >) any (), any ())). willReturn ( true );
146
144
this .server .expect (requestTo ("https://repo.spring.io/api/build/distribute/example-build/example-build-1" ))
147
145
.andExpect (method (HttpMethod .POST ))
148
146
.andExpect (content ().json (
@@ -154,8 +152,7 @@ void distributeWhenSuccessful() throws Exception {
154
152
this .service .distribute ("libs-release-local" , releaseInfo , artifactDigests );
155
153
this .server .verify ();
156
154
InOrder ordered = inOrder (this .bintrayService );
157
- ordered .verify (this .bintrayService ).isDistributionComplete (releaseInfo , artifactDigests , SHORT_TIMEOUT );
158
- ordered .verify (this .bintrayService ).isDistributionComplete (releaseInfo , artifactDigests , LONG_TIMEOUT );
155
+ ordered .verify (this .bintrayService ).isDistributionComplete (releaseInfo , artifactDigests , TIMEOUT );
159
156
}
160
157
161
158
@ Test
@@ -175,7 +172,7 @@ void distributeWhenFailure() throws Exception {
175
172
assertThatExceptionOfType (HttpClientErrorException .class )
176
173
.isThrownBy (() -> this .service .distribute ("libs-release-local" , releaseInfo , artifactDigests ));
177
174
this .server .verify ();
178
- verify (this .bintrayService , times (1 )).isDistributionComplete (releaseInfo , artifactDigests , SHORT_TIMEOUT );
175
+ verify (this .bintrayService , times (1 )).isDistributionStarted (releaseInfo );
179
176
verifyNoMoreInteractions (this .bintrayService );
180
177
}
181
178
@@ -199,8 +196,7 @@ void distributeWhenGettingPackagesTimesOut() throws Exception {
199
196
.isThrownBy (() -> this .service .distribute ("libs-release-local" , releaseInfo , artifactDigests ));
200
197
this .server .verify ();
201
198
InOrder ordered = inOrder (this .bintrayService );
202
- ordered .verify (this .bintrayService ).isDistributionComplete (releaseInfo , artifactDigests , SHORT_TIMEOUT );
203
- ordered .verify (this .bintrayService ).isDistributionComplete (releaseInfo , artifactDigests , LONG_TIMEOUT );
199
+ ordered .verify (this .bintrayService ).isDistributionComplete (releaseInfo , artifactDigests , TIMEOUT );
204
200
}
205
201
206
202
private ReleaseInfo getReleaseInfo () {
0 commit comments