postWithJsonContentShouldExecuteHttpPost() — spring-boot Function Reference
Architecture documentation for the postWithJsonContentShouldExecuteHttpPost() function in HttpClientTransportTests.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 82b6d6e1_ed40_be70_78e8_b37e675b3ede["postWithJsonContentShouldExecuteHttpPost()"] 674ffdc0_fae2_e6cd_cd20_ae283d48a4ca["givenClientWillReturnResponse()"] 82b6d6e1_ed40_be70_78e8_b37e675b3ede -->|calls| 674ffdc0_fae2_e6cd_cd20_ae283d48a4ca c3a4185f_576a_befe_15db_be38c37c3f74["writeToString()"] 82b6d6e1_ed40_be70_78e8_b37e675b3ede -->|calls| c3a4185f_576a_befe_15db_be38c37c3f74 style 82b6d6e1_ed40_be70_78e8_b37e675b3ede 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 165–186
@Test
void postWithJsonContentShouldExecuteHttpPost() 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_JSON,
(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(content.length());
assertThat(entity.getContentType()).isEqualTo(APPLICATION_JSON);
assertThat(entity.isStreaming()).isTrue();
assertThatExceptionOfType(UnsupportedOperationException.class).isThrownBy(entity::getContent);
assertThat(writeToString(entity)).isEqualTo(content);
assertThat(response.getContent()).isSameAs(this.content);
}), isNull());
}
Domain
Subdomains
Source
Frequently Asked Questions
What does postWithJsonContentShouldExecuteHttpPost() do?
postWithJsonContentShouldExecuteHttpPost() is a function in the spring-boot codebase.
What does postWithJsonContentShouldExecuteHttpPost() call?
postWithJsonContentShouldExecuteHttpPost() 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