Home / Function/ fromImageWritesToValidArchiveTar() — spring-boot Function Reference

fromImageWritesToValidArchiveTar() — spring-boot Function Reference

Architecture documentation for the fromImageWritesToValidArchiveTar() function in ImageArchiveTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  9541cc43_9c05_14f6_ef31_3ea500808315["fromImageWritesToValidArchiveTar()"]
  d418b23d_753d_7479_2803_95836fe0b005["getContent()"]
  9541cc43_9c05_14f6_ef31_3ea500808315 -->|calls| d418b23d_753d_7479_2803_95836fe0b005
  182ee4cd_aae6_3f69_85e7_266923ae4704["read()"]
  9541cc43_9c05_14f6_ef31_3ea500808315 -->|calls| 182ee4cd_aae6_3f69_85e7_266923ae4704
  7953766b_6d8a_8863_341d_4945a3f8bb51["assertExpectedLayer()"]
  9541cc43_9c05_14f6_ef31_3ea500808315 -->|calls| 7953766b_6d8a_8863_341d_4945a3f8bb51
  b7a265f4_665d_7fce_d822_bfe451ea6f05["assertExpectedConfig()"]
  9541cc43_9c05_14f6_ef31_3ea500808315 -->|calls| b7a265f4_665d_7fce_d822_bfe451ea6f05
  f86b8a47_d229_9bb6_0307_3e07d4dadb81["assertExpectedManifest()"]
  9541cc43_9c05_14f6_ef31_3ea500808315 -->|calls| f86b8a47_d229_9bb6_0307_3e07d4dadb81
  style 9541cc43_9c05_14f6_ef31_3ea500808315 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/type/ImageArchiveTests.java lines 45–70

	@Test
	void fromImageWritesToValidArchiveTar() throws Exception {
		Image image = Image.of(getContent("image.json"));
		ImageArchive archive = ImageArchive.from(image, (update) -> {
			update.withNewLayer(Layer.of((layout) -> layout.directory("/spring", Owner.ROOT)));
			update.withTag(ImageReference.of("pack.local/builder/6b7874626575656b6162"));
		});
		ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
		archive.writeTo(outputStream);
		try (TarArchiveInputStream tar = new TarArchiveInputStream(
				new ByteArrayInputStream(outputStream.toByteArray()))) {
			for (int i = 0; i < EXISTING_IMAGE_LAYER_COUNT; i++) {
				TarArchiveEntry blankEntry = tar.getNextEntry();
				assertThat(blankEntry.getName()).isEqualTo("blank_" + i);
			}
			TarArchiveEntry layerEntry = tar.getNextEntry();
			byte[] layerContent = read(tar, layerEntry.getSize());
			TarArchiveEntry configEntry = tar.getNextEntry();
			byte[] configContent = read(tar, configEntry.getSize());
			TarArchiveEntry manifestEntry = tar.getNextEntry();
			byte[] manifestContent = read(tar, manifestEntry.getSize());
			assertExpectedLayer(layerEntry, layerContent);
			assertExpectedConfig(configEntry, configContent);
			assertExpectedManifest(manifestEntry, manifestContent);
		}
	}

Domain

Subdomains

Frequently Asked Questions

What does fromImageWritesToValidArchiveTar() do?
fromImageWritesToValidArchiveTar() is a function in the spring-boot codebase.
What does fromImageWritesToValidArchiveTar() call?
fromImageWritesToValidArchiveTar() calls 5 function(s): assertExpectedConfig, assertExpectedLayer, assertExpectedManifest, getContent, read.

Analyze Your Own Codebase

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

Try Supermodel Free