Skip to content

Commit

Permalink
clean up test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhoon committed May 9, 2024
1 parent c2a0ceb commit 4be1d4f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions core/src/test/java/com/linecorp/armeria/ServiceFinderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

class ServiceFinderTest {
@RegisterExtension
static final ServerExtension server0 = new ServerExtension() {
static final ServerExtension server = new ServerExtension() {
@Override
protected void configure(ServerBuilder sb) {
sb.decorator(CorsService.builderForAnyOrigin().newDecorator());
Expand All @@ -53,20 +53,12 @@ protected void configure(ServerBuilder sb) {
}
};

@RegisterExtension
static final ServerExtension server1 = new ServerExtension() {
@Override
protected void configure(ServerBuilder sb) {
sb.service("/prefix/nested/service", new MyService().decorate(MyDecorator::new));
}
};

@Test
void shouldFindService() throws InterruptedException {
final BlockingWebClient client = server0.blockingWebClient();
final BlockingWebClient client = server.blockingWebClient();
final AggregatedHttpResponse res = client.get("/prefix/nested/service");
assertThat(res.status()).isEqualTo(HttpStatus.OK);
final ServiceRequestContext ctx = server0.requestContextCaptor().take();
final ServiceRequestContext ctx = server.requestContextCaptor().take();
assertThat(ctx.findService(CorsService.class)).isNotNull();
assertThat(ctx.findService(LoggingService.class)).isNotNull();
assertThat(ctx.findService(MyDecorator.class)).isNotNull();
Expand Down

0 comments on commit 4be1d4f

Please sign in to comment.