ApplicationWsDelegate { public void setDescription( String applicationName, String newDesc ) throws ApplicationWsException { this.logger.finer( "Updating the description of application " + applicationName + "." ); WebResource path = this.resource.path( UrlConstants.APP ).path( applicationName ).path( "description" ); ClientResponse response = this.wsClient.createBuilder( path ) .accept( MediaType.TEXT_PLAIN ) .post( ClientResponse.class, newDesc ); handleResponse( response ); this.logger.finer( String.valueOf( response.getStatusInfo())); } ApplicationWsDelegate( WebResource resource, WsClient wsClient ); void changeInstanceState( String applicationName, InstanceStatus newStatus, String instancePath ); void setDescription( String applicationName, String newDesc ); void deployAndStartAll( String applicationName, String instancePath ); void stopAll( String applicationName, String instancePath ); void undeployAll( String applicationName, String instancePath ); List<Instance> listChildrenInstances( String applicationName, String instancePath, boolean all ); void addInstance( String applicationName, String parentInstancePath, Instance instance ); void removeInstance( String applicationName, String instancePath ); void resynchronize( String applicationName ); List<Component> listAllComponents( String applicationName ); List<Component> findComponentChildren( String applicationName, String componentName ); List<Component> findComponentAncestors( String applicationName, String componentName ); void bindApplication( String applicationName, String boundTplName, String boundApp ); List<String> listAllCommands( String applicationName );  }
@Test public void testSetDescription_ok() throws Exception { String newDesc = "a new description"; this.app.setDirectory( this.folder.newFolder()); Assert.assertFalse( newDesc.equals( this.app.getDescription())); this.client.getApplicationDelegate().setDescription( this.app.getName(), newDesc ); Assert.assertEquals( newDesc, this.app.getDescription()); }
@Test( expected = ApplicationWsException.class ) public void testSetDescription_noApp() throws Exception { this.client.getApplicationDelegate().setDescription( "error", "new description" ); }