Skip to content

Commit

Permalink
added additional scenario using bodyValue method
Browse files Browse the repository at this point in the history
  • Loading branch information
rozagerardo committed Jan 25, 2021
1 parent a2239a2 commit 8b624f5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void givenDifferentScenarios_whenRequestsSent_thenObtainExpectedResponses
String bodyValue = "bodyValue";
RequestHeadersSpec<?> headerSpecPost1 = bodySpecPost.body(BodyInserters.fromPublisher(Mono.just(bodyValue), String.class));
RequestHeadersSpec<?> headerSpecPost2 = createDefaultPostResourceRequest().body(BodyInserters.fromValue(bodyValue));
RequestHeadersSpec<?> headerSpecPost3 = createDefaultPostResourceRequest().bodyValue(bodyValue);
RequestHeadersSpec<?> headerSpecFooPost = fooBodySpecPost.body(Mono.just(new Foo("fooName")), Foo.class);
RequestHeadersSpec<?> headerSpecGet = requestGet.uri("/resource");

Expand Down Expand Up @@ -115,6 +116,9 @@ public void givenDifferentScenarios_whenRequestsSent_thenObtainExpectedResponses
String responsePostWithBody1 = headerSpecPost1.retrieve()
.bodyToMono(String.class)
.block();
String responsePostWithBody2 = headerSpecPost2.retrieve()
.bodyToMono(String.class)
.block();
String responsePostWithBody3 = headerSpecPost2.retrieve()
.bodyToMono(String.class)
.block();
Expand All @@ -136,6 +140,7 @@ public void givenDifferentScenarios_whenRequestsSent_thenObtainExpectedResponses
assertThat(responsePostString).isEqualTo("processed-bodyValue");
assertThat(responsePostMultipart).isEqualTo("processed-multipartValue1-multipartValue2");
assertThat(responsePostWithBody1).isEqualTo("processed-bodyValue");
assertThat(responsePostWithBody2).isEqualTo("processed-bodyValue");
assertThat(responsePostWithBody3).isEqualTo("processed-bodyValue");
assertThat(responseGet).containsEntry("field", "value");
assertThat(responsePostFoo).isEqualTo("processedFoo-fooName");
Expand Down

0 comments on commit 8b624f5

Please sign in to comment.