AbstractRoutingClient implements IMessagingClient { protected boolean canProceed() { return ! this.connectionIsRequired || this.connected.get(); } AbstractRoutingClient( RoutingContext routingContext, RecipientKind ownerKind ); @Override void closeConnection(); @Override void openConnection(); @Override Map<String,String> getConfiguration(); @Override void deleteMessagingServerArtifacts( Application application ); @Override boolean isConnected(); @Override void subscribe( MessagingContext ctx ); @Override void unsubscribe( MessagingContext ctx ); @Override void publish( MessagingContext ctx, Message msg ); @Override void setOwnerProperties( RecipientKind ownerKind, String domain, String applicationName, String scopedInstancePath ); RoutingContext getRoutingContext(); String getOwnerId(); static String buildOwnerId( RecipientKind ownerKind, String applicationName, String scopedInstancePath ); static String buildOwnerId( MessagingContext ctx );  }
@Test public void testCanProceed() { CanProceedTest c1 = new CanProceedTest( true ); c1.connected.set( true ); Assert.assertTrue( c1.canProceed()); c1.connected.set( false ); Assert.assertFalse( c1.canProceed()); CanProceedTest c2 = new CanProceedTest( false ); c2.connected.set( true ); Assert.assertTrue( c2.canProceed()); c2.connected.set( false ); Assert.assertTrue( c2.canProceed()); }