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

exportLayersExportsLayerTars() — spring-boot Function Reference

Architecture documentation for the exportLayersExportsLayerTars() function in DockerApiTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  929487dd_04c5_2cdd_78ba_05b94c39fde9["exportLayersExportsLayerTars()"]
  88e4c755_21cd_03d2_7b78_c0a678363843["responseOf()"]
  929487dd_04c5_2cdd_78ba_05b94c39fde9 -->|calls| 88e4c755_21cd_03d2_7b78_c0a678363843
  b3171812_ab1f_87c4_a83a_2a91e929e461["getName()"]
  929487dd_04c5_2cdd_78ba_05b94c39fde9 -->|calls| b3171812_ab1f_87c4_a83a_2a91e929e461
  c11580dd_aefa_2785_5004_3738b7d99bd8["writeTo()"]
  929487dd_04c5_2cdd_78ba_05b94c39fde9 -->|calls| c11580dd_aefa_2785_5004_3738b7d99bd8
  style 929487dd_04c5_2cdd_78ba_05b94c39fde9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java lines 476–502

		@Test
		void exportLayersExportsLayerTars() throws Exception {
			ImageReference reference = ImageReference.of("docker.io/paketobuildpacks/builder:base");
			URI exportUri = new URI(IMAGES_URL + "/docker.io/paketobuildpacks/builder:base/get");
			given(DockerApiTests.this.http.get(exportUri)).willReturn(responseOf("export.tar"));
			MultiValueMap<String, String> contents = new LinkedMultiValueMap<>();
			this.api.exportLayers(reference, (name, archive) -> {
				ByteArrayOutputStream out = new ByteArrayOutputStream();
				archive.writeTo(out);
				try (TarArchiveInputStream in = new TarArchiveInputStream(
						new ByteArrayInputStream(out.toByteArray()))) {
					TarArchiveEntry entry = in.getNextEntry();
					while (entry != null) {
						contents.add(name, entry.getName());
						entry = in.getNextEntry();
					}
				}
			});
			assertThat(contents).hasSize(3)
				.containsKeys("70bb7a3115f3d5c01099852112c7e05bf593789e510468edb06b6a9a11fa3b73/layer.tar",
						"74a9a50ece13c025cf10e9110d9ddc86c995079c34e2a22a28d1a3d523222c6e/layer.tar",
						"a69532b5b92bb891fbd9fa1a6b3af9087ea7050255f59ba61a796f8555ecd783/layer.tar");
			assertThat(contents.get("70bb7a3115f3d5c01099852112c7e05bf593789e510468edb06b6a9a11fa3b73/layer.tar"))
				.containsExactly("/cnb/order.toml");
			assertThat(contents.get("74a9a50ece13c025cf10e9110d9ddc86c995079c34e2a22a28d1a3d523222c6e/layer.tar"))
				.containsExactly("/cnb/stack.toml");
		}

Subdomains

Frequently Asked Questions

What does exportLayersExportsLayerTars() do?
exportLayersExportsLayerTars() is a function in the spring-boot codebase.
What does exportLayersExportsLayerTars() call?
exportLayersExportsLayerTars() calls 3 function(s): getName, responseOf, writeTo.

Analyze Your Own Codebase

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

Try Supermodel Free