Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Fixup failing tests
Browse files Browse the repository at this point in the history
See gh-51
  • Loading branch information
philwebb committed Apr 11, 2019
1 parent 797b828 commit b2269e1
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.test.web.client.RequestMatcher;
import org.springframework.web.client.HttpClientErrorException;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.header;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
Expand Down Expand Up @@ -136,7 +134,7 @@ public void deployWhenChecksumMatchesDoesNotUpload() throws Exception {
}

@Test
public void deployWhenChecksumUploadFailsWithHttpClientErrorExceptionThrows()
public void deployWhenChecksumUploadFailsWithHttpClientErrorExceptionUploads()
throws Exception {
DeployableArtifact artifact = new DeployableByteArrayArtifact("/foo/bar.jar",
BYTES);
Expand All @@ -145,8 +143,11 @@ public void deployWhenChecksumUploadFailsWithHttpClientErrorExceptionThrows()
.andExpect(header("X-Checksum-Deploy", "true"))
.andExpect(header("X-Checksum-Sha1", artifact.getChecksums().getSha1()))
.andRespond(withStatus(HttpStatus.REQUESTED_RANGE_NOT_SATISFIABLE));
assertThatExceptionOfType(HttpClientErrorException.class)
.isThrownBy(() -> this.artifactoryRepository.deploy(artifact));
this.server.expect(requestTo(url)).andExpect(method(HttpMethod.PUT))
.andExpect(header("X-Checksum-Sha1", artifact.getChecksums().getSha1()))
.andRespond(withSuccess());
this.artifactoryRepository.deploy(artifact);
this.server.verify();
}

@Test
Expand Down

0 comments on commit b2269e1

Please sign in to comment.