@Test
public void testExecute_valid_withSpecifiedInstance_deployed() throws Exception {

	this.gl.applicationName = this.app.getName();
	this.gl.scopedInstancePath = InstanceHelpers.computeInstancePath( this.app.getTomcatVm());
	this.app.getTomcatVm().setStatus( InstanceStatus.DEPLOYED_STARTED );
	// Hack for code coverage
	this.gl.logger.setLevel( Level.FINE );
	// End of hack
	ByteArrayOutputStream os = new ByteArrayOutputStream();
	this.gl.out = new PrintStream( os, true, "UTF-8" );
	this.gl.execute();
	Mockito.verify( this.applicationMngr, Mockito.times( 1 )).findManagedApplicationByName( this.gl.applicationName );
	String s = os.toString( "UTF-8" ).trim();
	Assert.assertTrue( s.startsWith( "On reception" ));
	Assert.assertTrue( s.endsWith( "/roboconf-logs..." ));
	ArgumentCaptor<Message> msg = ArgumentCaptor.forClass( Message.class );
	Mockito.verify( this.messagingMngr, Mockito.times( 1 )).sendMessageSafely(
			Mockito.eq( this.ma ),
			Mockito.eq( this.app.getTomcatVm()),
			msg.capture());
	Assert.assertEquals( MsgCmdGatherLogs.class, msg.getValue().getClass());
}