QueryService extends QueryServiceGrpc.QueryServiceImplBase implements Logging { public static Builder newBuilder() { return new Builder(); } private  QueryService(Map<TypeUrl, BoundedContext> map); static Builder newBuilder(); @Override void read(Query query, StreamObserver<QueryResponse> responseObserver);  }
@Test @DisplayName("fail to create with Bounded Context removed from builder") void notCreateWithRemovedBc() { BoundedContext boundedContext = BoundedContextBuilder.assumingTests().build(); QueryService.Builder builder = QueryService.newBuilder(); assertThrows(IllegalStateException.class, () -> builder.add(boundedContext) .remove(boundedContext) .build()); }
@Test @DisplayName("fail to create with no Bounded Context") void notCreateWithNoBc() { assertThrows(IllegalStateException.class, () -> QueryService.newBuilder() .build()); }