Merge branch '2.3.x'
Closes gh-23133
This commit is contained in:
@@ -51,6 +51,7 @@ import org.springframework.boot.buildpack.platform.io.TarArchive;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
@@ -172,6 +173,16 @@ class DockerApiTests {
|
||||
.withMessage("Listener must not be null");
|
||||
}
|
||||
|
||||
@Test // gh-23130
|
||||
void loadWithEmptyResponseThrowsException() throws Exception {
|
||||
Image image = Image.of(getClass().getResourceAsStream("type/image.json"));
|
||||
ImageArchive archive = ImageArchive.from(image);
|
||||
URI loadUri = new URI(IMAGES_URL + "/load");
|
||||
given(http().post(eq(loadUri), eq("application/x-tar"), any())).willReturn(emptyResponse());
|
||||
assertThatIllegalStateException().isThrownBy(() -> this.api.load(archive, this.loadListener))
|
||||
.withMessageContaining("Invalid response received");
|
||||
}
|
||||
|
||||
@Test
|
||||
void loadLoadsImage() throws Exception {
|
||||
Image image = Image.of(getClass().getResourceAsStream("type/image.json"));
|
||||
|
||||
Reference in New Issue
Block a user