Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.net.MalformedURLException;
Expand Down Expand Up @@ -124,7 +124,8 @@ public void getRequestTest() throws MalformedURLException {
.build();

HttpRequest request = new HttpRequest(HttpMethod.GET, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -138,7 +139,8 @@ public void postRequestTest() throws MalformedURLException {

HttpRequest request = new HttpRequest(HttpMethod.POST, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
request.setBody("{\"propName\":\"name\", \"propValue\": \"value\"}");
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -152,7 +154,8 @@ public void postRequestWithPortTest() throws MalformedURLException {

HttpRequest request = new HttpRequest(HttpMethod.POST, new URL("https://localhost:443?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
request.setBody("{\"propName\":\"name\", \"propValue\": \"value\"}");
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -166,7 +169,8 @@ public void crossLanguageAsciiHashMatchTest() throws MalformedURLException {

HttpRequest request = new HttpRequest(HttpMethod.POST, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
request.setBody("banana");
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -180,7 +184,8 @@ public void crossLanguageUnicodeHashMatchTest() throws MalformedURLException {

HttpRequest request = new HttpRequest(HttpMethod.POST, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
request.setBody("😀");
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -194,7 +199,8 @@ public void patchRequestTest() throws MalformedURLException {

HttpRequest request = new HttpRequest(HttpMethod.PATCH, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
request.setBody("{\"propName\":\"name1\", \"propValue\": \"value1\"}");
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -208,7 +214,8 @@ public void putRequestTest() throws MalformedURLException {

HttpRequest request = new HttpRequest(HttpMethod.PUT, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
request.setBody("{\"propName\":\"name2\", \"propValue\": \"value2\"}");
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -221,7 +228,8 @@ public void deleteRequestTest() throws MalformedURLException {
.build();

HttpRequest request = new HttpRequest(HttpMethod.DELETE, new URL("https://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
pipeline.send(request).block();
StepVerifier.create(pipeline.send(request))
.verifyComplete();
}

@Test
Expand All @@ -234,9 +242,8 @@ public void httpRequestTest() throws MalformedURLException {
.build();

HttpRequest request = new HttpRequest(HttpMethod.GET, new URL("http://localhost?id=b93a5ef4-f622-44d8-a80b-ff983122554e"));
assertThrows(RuntimeException.class, () -> {
pipeline.send(request).block();
});
StepVerifier.create(pipeline.send(request))
.expectError(RuntimeException.class);
}

}