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

createWhenHasContentContainerWithContent() — spring-boot Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  5c5ccd26_1928_bfbc_252c_a05e3a07cfc7["createWhenHasContentContainerWithContent()"]
  274a52b3_b07b_ef2a_172f_1c8b25267451["withCommand()"]
  5c5ccd26_1928_bfbc_252c_a05e3a07cfc7 -->|calls| 274a52b3_b07b_ef2a_172f_1c8b25267451
  ffedf588_7c32_be87_49b5_6f0bec311aa1["http()"]
  5c5ccd26_1928_bfbc_252c_a05e3a07cfc7 -->|calls| ffedf588_7c32_be87_49b5_6f0bec311aa1
  88e4c755_21cd_03d2_7b78_c0a678363843["responseOf()"]
  5c5ccd26_1928_bfbc_252c_a05e3a07cfc7 -->|calls| 88e4c755_21cd_03d2_7b78_c0a678363843
  5ebda6ce_1915_7ec7_82b6_9dbaace8503c["emptyResponse()"]
  5c5ccd26_1928_bfbc_252c_a05e3a07cfc7 -->|calls| 5ebda6ce_1915_7ec7_82b6_9dbaace8503c
  759ca794_5cea_60bd_cef5_13bbbdbfd61c["toString()"]
  5c5ccd26_1928_bfbc_252c_a05e3a07cfc7 -->|calls| 759ca794_5cea_60bd_cef5_13bbbdbfd61c
  style 5c5ccd26_1928_bfbc_252c_a05e3a07cfc7 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 669–692

		@Test
		void createWhenHasContentContainerWithContent() throws Exception {
			ImageReference imageReference = ImageReference.of("ubuntu:bionic");
			ContainerConfig config = ContainerConfig.of(imageReference, (update) -> update.withCommand("/bin/bash"));
			TarArchive archive = TarArchive.of((layout) -> {
				layout.directory("/test", Owner.ROOT);
				layout.file("/test/file", Owner.ROOT, Content.of("test"));
			});
			ContainerContent content = ContainerContent.of(archive);
			URI createUri = new URI(CONTAINERS_URL + "/create");
			given(http().post(eq(createUri), eq("application/json"), any()))
				.willReturn(responseOf("create-container-response.json"));
			URI uploadUri = new URI(CONTAINERS_URL + "/e90e34656806/archive?path=%2F");
			given(http().put(eq(uploadUri), eq("application/x-tar"), any())).willReturn(emptyResponse());
			ContainerReference containerReference = this.api.create(config, null, content);
			assertThat(containerReference).hasToString("e90e34656806");
			then(http()).should().post(any(), any(), this.writer.capture());
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			this.writer.getValue().accept(out);
			assertThat(out.toByteArray()).hasSize(config.toString().length());
			then(http()).should().put(any(), any(), this.writer.capture());
			this.writer.getValue().accept(out);
			assertThat(out.toByteArray()).hasSizeGreaterThan(2000);
		}

Subdomains

Frequently Asked Questions

What does createWhenHasContentContainerWithContent() do?
createWhenHasContentContainerWithContent() is a function in the spring-boot codebase.
What does createWhenHasContentContainerWithContent() call?
createWhenHasContentContainerWithContent() calls 5 function(s): emptyResponse, http, responseOf, toString, withCommand.

Analyze Your Own Codebase

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

Try Supermodel Free