use of io.spine.server.stand.Stand in project core-java by SpineEventEngine.
the class SubscriptionService method subscribe.
@Override
public void subscribe(Topic topic, StreamObserver<Subscription> responseObserver) {
log().debug("Creating the subscription to a topic: {}", topic);
try {
final Target target = topic.getTarget();
final BoundedContext boundedContext = selectBoundedContext(target);
final Stand stand = boundedContext.getStand();
stand.subscribe(topic, responseObserver);
} catch (@SuppressWarnings("OverlyBroadCatchBlock") Exception e) {
log().error("Error processing subscription request", e);
responseObserver.onError(e);
}
}
use of io.spine.server.stand.Stand in project core-java by SpineEventEngine.
the class BoundedContextShould method propagate_registered_repositories_to_stand.
@Test
public void propagate_registered_repositories_to_stand() {
final BoundedContext boundedContext = BoundedContext.newBuilder().build();
final Stand stand = Spy.ofClass(Stand.class).on(boundedContext);
verify(stand, never()).registerTypeSupplier(any(Repository.class));
final ProjectAggregateRepository repository = new ProjectAggregateRepository(boundedContext);
boundedContext.register(repository);
verify(stand).registerTypeSupplier(eq(repository));
}
Aggregations