@Test public void testSendPingMessageQueue_messagingException() throws Exception { Mockito.doThrow( new IOException( "for test" ) ).when( this.messagingMngr ).sendMessageToTheDm( Mockito.any( Message.class )); Mockito.verifyZeroInteractions( this.messagingMngr ); Assert.assertFalse( this.mngr.pingMessageQueue( "TEST" )); Mockito.verify( this.messagingMngr, Mockito.times( 1 )).sendMessageToTheDm( Mockito.any( Message.class )); }
@Override public boolean pingMessageQueue( String message ) { boolean sent = false; final MsgEcho sentMessage = new MsgEcho( message ); try { this.messagingMngr.sendMessageToTheDm( sentMessage ); sent = true; this.logger.fine( "Sent Echo message on debug queue. Message=" + message + ", UUID=" + sentMessage.getUuid()); } catch( IOException e ) { this.logger.fine( "No Echo message was sent on debug queue. An error occurred with the messaging." ); Utils.logException( this.logger, e ); } return sent; }
DebugMngrImpl implements IDebugMngr { @Override public boolean pingMessageQueue( String message ) { boolean sent = false; final MsgEcho sentMessage = new MsgEcho( message ); try { this.messagingMngr.sendMessageToTheDm( sentMessage ); sent = true; this.logger.fine( "Sent Echo message on debug queue. Message=" + message + ", UUID=" + sentMessage.getUuid()); } catch( IOException e ) { this.logger.fine( "No Echo message was sent on debug queue. An error occurred with the messaging." ); Utils.logException( this.logger, e ); } return sent; } }
DebugMngrImpl implements IDebugMngr { @Override public boolean pingMessageQueue( String message ) { boolean sent = false; final MsgEcho sentMessage = new MsgEcho( message ); try { this.messagingMngr.sendMessageToTheDm( sentMessage ); sent = true; this.logger.fine( "Sent Echo message on debug queue. Message=" + message + ", UUID=" + sentMessage.getUuid()); } catch( IOException e ) { this.logger.fine( "No Echo message was sent on debug queue. An error occurred with the messaging." ); Utils.logException( this.logger, e ); } return sent; } DebugMngrImpl( IMessagingMngr messagingMngr, INotificationMngr notificationMngr ); }
DebugMngrImpl implements IDebugMngr { @Override public boolean pingMessageQueue( String message ) { boolean sent = false; final MsgEcho sentMessage = new MsgEcho( message ); try { this.messagingMngr.sendMessageToTheDm( sentMessage ); sent = true; this.logger.fine( "Sent Echo message on debug queue. Message=" + message + ", UUID=" + sentMessage.getUuid()); } catch( IOException e ) { this.logger.fine( "No Echo message was sent on debug queue. An error occurred with the messaging." ); Utils.logException( this.logger, e ); } return sent; } DebugMngrImpl( IMessagingMngr messagingMngr, INotificationMngr notificationMngr ); @Override boolean pingMessageQueue( String message ); @Override int pingAgent( ManagedApplication app, Instance scopedInstance, String message ); @Override void notifyMsgEchoReceived( MsgEcho message ); }
DebugMngrImpl implements IDebugMngr { @Override public boolean pingMessageQueue( String message ) { boolean sent = false; final MsgEcho sentMessage = new MsgEcho( message ); try { this.messagingMngr.sendMessageToTheDm( sentMessage ); sent = true; this.logger.fine( "Sent Echo message on debug queue. Message=" + message + ", UUID=" + sentMessage.getUuid()); } catch( IOException e ) { this.logger.fine( "No Echo message was sent on debug queue. An error occurred with the messaging." ); Utils.logException( this.logger, e ); } return sent; } DebugMngrImpl( IMessagingMngr messagingMngr, INotificationMngr notificationMngr ); @Override boolean pingMessageQueue( String message ); @Override int pingAgent( ManagedApplication app, Instance scopedInstance, String message ); @Override void notifyMsgEchoReceived( MsgEcho message );  }