DebugResource implements IDebugResource { @Override public List<Diagnostic> diagnoseApplication( String applicationName ) { this.logger.fine( "Request: create a diagnostic for the application called " + applicationName + "." ); List<Diagnostic> result = new ArrayList<> (); final Application application = this.manager.applicationMngr().findApplicationByName( applicationName ); if( application != null ) { for( Instance inst : InstanceHelpers.getAllInstances( application )) result.add( createDiagnostic( inst )); } return result; } DebugResource( Manager manager ); @Override Response checkMessagingConnectionForTheDm( String message ); @Override Response checkMessagingConnectionWithAgent(
			String applicationName,
			String scopedInstancePath,
			String message ); @Override Response diagnoseInstance( String applicationName, String instancePath ); @Override List<Diagnostic> diagnoseApplication( String applicationName );  }
@Test public void testDiagnoseApplication() throws Exception { ManagedApplication ma = new ManagedApplication( this.app ); this.managerWrapper.addManagedApplication( ma ); List<Diagnostic> diags = this.resource.diagnoseApplication( "inexisting" ); Assert.assertEquals( 0, diags.size()); diags = this.resource.diagnoseApplication( this.app.getName()); Assert.assertEquals( InstanceHelpers.getAllInstances( this.app ).size(), diags.size()); for( Diagnostic diag : diags ) { Instance inst = InstanceHelpers.findInstanceByPath( this.app, diag.getInstancePath()); Assert.assertNotNull( inst ); for( DependencyInformation info : diag.getDependenciesInformation()) { Assert.assertFalse( info.isResolved()); } } }