Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-v committed Jan 12, 2025
1 parent a651770 commit 1d11e52
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

import io.scalecube.services.methods.RequestContext;
import reactor.core.publisher.Mono;
Expand All @@ -16,6 +17,7 @@ public Mono<SomeResponse> options() {
final var foo = context.pathVar("foo");
assertNotNull(foo);
assertNotNull(context.headers());
assertTrue(context.headers().size() > 0);
assertEquals("OPTIONS", context.method());
return new SomeResponse().name(foo);
});
Expand All @@ -29,6 +31,7 @@ public Mono<SomeResponse> get() {
final var foo = context.pathVar("foo");
assertNotNull(foo);
assertNotNull(context.headers());
assertTrue(context.headers().size() > 0);
assertEquals("GET", context.method());
return new SomeResponse().name(foo);
});
Expand All @@ -42,6 +45,7 @@ public Mono<SomeResponse> head() {
final var foo = context.pathVar("foo");
assertNotNull(foo);
assertNotNull(context.headers());
assertTrue(context.headers().size() > 0);
assertEquals("HEAD", context.method());
return new SomeResponse().name(foo);
});
Expand All @@ -54,7 +58,7 @@ public Mono<SomeResponse> post(SomeRequest request) {
context -> {
assertNotNull(context.pathVar("foo"));
assertNotNull(context.headers());
assertNotNull(request);
assertTrue(context.headers().size() > 0);
assertEquals("POST", context.method());
return new SomeResponse().name(request.name());
});
Expand All @@ -67,7 +71,7 @@ public Mono<SomeResponse> put(SomeRequest request) {
context -> {
assertNotNull(context.pathVar("foo"));
assertNotNull(context.headers());
assertNotNull(request);
assertTrue(context.headers().size() > 0);
assertEquals("PUT", context.method());
return new SomeResponse().name(request.name());
});
Expand All @@ -80,7 +84,7 @@ public Mono<SomeResponse> patch(SomeRequest request) {
context -> {
assertNotNull(context.pathVar("foo"));
assertNotNull(context.headers());
assertNotNull(request);
assertTrue(context.headers().size() > 0);
assertEquals("PATCH", context.method());
return new SomeResponse().name(request.name());
});
Expand All @@ -93,6 +97,7 @@ public Mono<SomeResponse> delete(SomeRequest request) {
context -> {
assertNotNull(context.pathVar("foo"));
assertNotNull(context.headers());
assertTrue(context.headers().size() > 0);
assertEquals("DELETE", context.method());
return new SomeResponse().name(request.name());
});
Expand All @@ -106,6 +111,7 @@ public Mono<SomeResponse> trace() {
final var foo = context.pathVar("foo");
assertNotNull(foo);
assertNotNull(context.headers());
assertTrue(context.headers().size() > 0);
assertEquals("TRACE", context.method());
return new SomeResponse().name(foo);
});
Expand All @@ -118,6 +124,7 @@ public Mono<SomeResponse> connect(SomeRequest request) {
context -> {
assertNotNull(context.pathVar("foo"));
assertNotNull(context.headers());
assertTrue(context.headers().size() > 0);
assertEquals("CONNECT", context.method());
return new SomeResponse().name(request.name());
});
Expand Down

0 comments on commit 1d11e52

Please sign in to comment.