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

postWithArchiveContentShouldExecuteHttpPost() — spring-boot Function Reference

Architecture documentation for the postWithArchiveContentShouldExecuteHttpPost() function in HttpClientTransportTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  4021083e_f823_1747_e4ea_ffb13b7f3fd9["postWithArchiveContentShouldExecuteHttpPost()"]
  674ffdc0_fae2_e6cd_cd20_ae283d48a4ca["givenClientWillReturnResponse()"]
  4021083e_f823_1747_e4ea_ffb13b7f3fd9 -->|calls| 674ffdc0_fae2_e6cd_cd20_ae283d48a4ca
  c3a4185f_576a_befe_15db_be38c37c3f74["writeToString()"]
  4021083e_f823_1747_e4ea_ffb13b7f3fd9 -->|calls| c3a4185f_576a_befe_15db_be38c37c3f74
  style 4021083e_f823_1747_e4ea_ffb13b7f3fd9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

buildpack/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/transport/HttpClientTransportTests.java lines 188–209

	@Test
	void postWithArchiveContentShouldExecuteHttpPost() throws Exception {
		String content = "test";
		givenClientWillReturnResponse();
		given(this.entity.getContent()).willReturn(this.content);
		given(this.response.getCode()).willReturn(200);
		Response response = this.http.post(this.uri, APPLICATION_X_TAR,
				(out) -> StreamUtils.copy(content, StandardCharsets.UTF_8, out));
		then(this.client).should()
			.executeOpen(any(HttpHost.class), assertArg((ThrowingConsumer<HttpPost>) (request) -> {
				HttpEntity entity = request.getEntity();
				assertThat(request).isInstanceOf(HttpPost.class);
				assertThat(request.getUri()).isEqualTo(this.uri);
				assertThat(entity.isRepeatable()).isFalse();
				assertThat(entity.getContentLength()).isEqualTo(-1);
				assertThat(entity.getContentType()).isEqualTo(APPLICATION_X_TAR);
				assertThat(entity.isStreaming()).isTrue();
				assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(entity::getContent);
				assertThat(writeToString(entity)).isEqualTo(content);
				assertThat(response.getContent()).isSameAs(this.content);
			}), isNull());
	}

Domain

Subdomains

Frequently Asked Questions

What does postWithArchiveContentShouldExecuteHttpPost() do?
postWithArchiveContentShouldExecuteHttpPost() is a function in the spring-boot codebase.
What does postWithArchiveContentShouldExecuteHttpPost() call?
postWithArchiveContentShouldExecuteHttpPost() calls 2 function(s): givenClientWillReturnResponse, writeToString.

Analyze Your Own Codebase

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

Try Supermodel Free