DebugWsDelegate { public List<Diagnostic> diagnoseApplication( String applicationName ) { this.logger.finer( "Diagnosing application " + applicationName ); WebResource path = this.resource.path( UrlConstants.DEBUG ).path( "diagnose-application" ); path = path.queryParam( "application-name", applicationName ); List<Diagnostic> result = this.wsClient.createBuilder( path ) .accept( MediaType.APPLICATION_JSON ) .get( new GenericType<List<Diagnostic>> () {}); if( result == null ) this.logger.finer( "No diagnostic was returned for application " + applicationName ); return result; } DebugWsDelegate( WebResource resource, WsClient wsClient ); String checkMessagingConnectionForTheDm( String message ); String checkMessagingConnectionWithAgent( String applicationName, String scopedInstancePath, String message ); Diagnostic diagnoseInstance( String applicationName, String instancePath ); List<Diagnostic> diagnoseApplication( String applicationName );  }
@Test public void testDiagnoseApplication() throws Exception { List<Diagnostic> diags = this.client.getDebugDelegate().diagnoseApplication( "invalid" ); Assert.assertEquals( 0, diags.size()); ManagedApplication ma = new ManagedApplication( this.app ); this.managerWrapper.addManagedApplication( ma ); diags = this.client.getDebugDelegate().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()); } } }