@Test @MockitoSettings(strictness = Strictness.LENIENT) void testLocalSegmentReturnsTheCommandBusConnectorsLocalSegmentResult() { CommandBus expectedLocalSegment = mock(CommandBus.class); when(mockConnector.localSegment()).thenReturn(Optional.of(expectedLocalSegment)); CommandBus resultLocalSegment = testSubject.localSegment(); assertEquals(expectedLocalSegment, resultLocalSegment); }
@Override public CommandBus localSegment() { return connector.localSegment().orElse(this); }
DistributedCommandBus implements CommandBus, Distributed<CommandBus> { @Override public CommandBus localSegment() { return connector.localSegment().orElse(this); } }
DistributedCommandBus implements CommandBus, Distributed<CommandBus> { @Override public CommandBus localSegment() { return connector.localSegment().orElse(this); } protected  DistributedCommandBus(Builder builder); }
DistributedCommandBus implements CommandBus, Distributed<CommandBus> { @Override public CommandBus localSegment() { return connector.localSegment().orElse(this); } protected  DistributedCommandBus(Builder builder); static Builder builder(); @ShutdownHandler(phase = Phase.INBOUND_COMMAND_CONNECTOR) void disconnect(); @ShutdownHandler(phase = Phase.OUTBOUND_COMMAND_CONNECTORS) CompletableFuture<Void> shutdownDispatching(); @Override void dispatch(CommandMessage<C> command); @Override void dispatch(CommandMessage<C> command, CommandCallback<? super C, ? super R> callback); @Override Registration subscribe(String commandName, MessageHandler<? super CommandMessage<?>> handler); @Override CommandBus localSegment(); int getLoadFactor(); void updateLoadFactor(int loadFactor); Registration registerDispatchInterceptor(
            MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor); @Override Registration registerHandlerInterceptor(
            MessageHandlerInterceptor<? super CommandMessage<?>> handlerInterceptor); }
DistributedCommandBus implements CommandBus, Distributed<CommandBus> { @Override public CommandBus localSegment() { return connector.localSegment().orElse(this); } protected  DistributedCommandBus(Builder builder); static Builder builder(); @ShutdownHandler(phase = Phase.INBOUND_COMMAND_CONNECTOR) void disconnect(); @ShutdownHandler(phase = Phase.OUTBOUND_COMMAND_CONNECTORS) CompletableFuture<Void> shutdownDispatching(); @Override void dispatch(CommandMessage<C> command); @Override void dispatch(CommandMessage<C> command, CommandCallback<? super C, ? super R> callback); @Override Registration subscribe(String commandName, MessageHandler<? super CommandMessage<?>> handler); @Override CommandBus localSegment(); int getLoadFactor(); void updateLoadFactor(int loadFactor); Registration registerDispatchInterceptor(
            MessageDispatchInterceptor<? super CommandMessage<?>> dispatchInterceptor); @Override Registration registerHandlerInterceptor(
            MessageHandlerInterceptor<? super CommandMessage<?>> handlerInterceptor); static final int INITIAL_LOAD_FACTOR; }