Home / Class/ BuildImageRegistryIntegrationTests Class — spring-boot Architecture

BuildImageRegistryIntegrationTests Class — spring-boot Architecture

Architecture documentation for the BuildImageRegistryIntegrationTests class in BuildImageRegistryIntegrationTests.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

build-plugin/spring-boot-maven-plugin/src/dockerTest/java/org/springframework/boot/maven/BuildImageRegistryIntegrationTests.java lines 41–80

@ExtendWith(MavenBuildExtension.class)
@Testcontainers(disabledWithoutDocker = true)
@Disabled("Disabled until differences between running locally and in CI can be diagnosed")
class BuildImageRegistryIntegrationTests extends AbstractArchiveIntegrationTests {

	@Container
	static final RegistryContainer registry = TestImage.container(RegistryContainer.class);

	DockerClient dockerClient;

	String registryAddress;

	@BeforeEach
	void setUp() {
		assertThat(registry.isRunning()).isTrue();
		this.dockerClient = registry.getDockerClient();
		this.registryAddress = registry.getHost() + ":" + registry.getFirstMappedPort();
	}

	@TestTemplate
	void whenBuildImageIsInvokedWithPublish(MavenBuild mavenBuild) {
		String repoName = "test-image";
		String imageName = this.registryAddress + "/" + repoName;
		mavenBuild.project("dockerTest", "build-image-publish")
			.goals("package")
			.systemProperty("spring-boot.build-image.imageName", imageName)
			.execute((project) -> {
				assertThat(buildLog(project)).contains("Building image")
					.contains("Successfully built image")
					.contains("Pushing image '" + imageName + ":latest" + "'")
					.contains("Pushed image '" + imageName + ":latest" + "'");
				ImageReference imageReference = ImageReference.of(imageName);
				DockerApi.ImageApi imageApi = new DockerApi().image();
				Image pulledImage = imageApi.pull(imageReference, null, UpdateListener.none());
				assertThat(pulledImage).isNotNull();
				imageApi.remove(imageReference, false);
			});
	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free