BraveService extends SimpleDecoratingHttpService { public static Function<? super HttpService, BraveService> newDecorator(Tracing tracing) { return newDecorator(HttpTracing.newBuilder(tracing) .serverRequestParser(ArmeriaHttpServerParser.get()) .serverResponseParser(ArmeriaHttpServerParser.get()) .build()); } private  BraveService(HttpService delegate, HttpTracing httpTracing); static Function<? super HttpService, BraveService> newDecorator(Tracing tracing); static Function<? super HttpService, BraveService> newDecorator(HttpTracing httpTracing); @Override HttpResponse serve(ServiceRequestContext ctx, HttpRequest req);  }
@Test void newDecorator_shouldFailFastWhenRequestContextCurrentTraceContextNotConfigured() { assertThatThrownBy(() -> BraveService.newDecorator(HttpTracing.create(Tracing.newBuilder().build()))) .isInstanceOf(IllegalStateException.class).hasMessage( "Tracing.currentTraceContext is not a RequestContextCurrentTraceContext scope. Please " + "call Tracing.Builder.currentTraceContext(RequestContextCurrentTraceContext.ofDefault())." ); }
@Test void newDecorator_shouldWorkWhenRequestContextCurrentTraceContextConfigured() { BraveService.newDecorator( HttpTracing.create( Tracing.newBuilder() .currentTraceContext(RequestContextCurrentTraceContext.ofDefault()) .build())); }