@Test public void testCreateTarget() throws Exception { String content = "handler: h\nid: toto\nprop: ok"; String targetId = this.client.getTargetWsDelegate().createTarget( content ); String read = this.manager.targetsMngr().findTargetProperties( targetId ).asString(); Assert.assertEquals( "handler: h\nprop: ok", read ); }
public String createTarget( String targetContent ) throws TargetWsException { this.logger.finer( "Creating a new target." ); WebResource path = this.resource.path( UrlConstants.TARGETS ); ClientResponse response = this.wsClient.createBuilder( path ).post( ClientResponse.class, targetContent ); handleResponse( response ); return response.getEntity( String.class ); }
TargetWsDelegate { public String createTarget( String targetContent ) throws TargetWsException { this.logger.finer( "Creating a new target." ); WebResource path = this.resource.path( UrlConstants.TARGETS ); ClientResponse response = this.wsClient.createBuilder( path ).post( ClientResponse.class, targetContent ); handleResponse( response ); return response.getEntity( String.class ); } }
TargetWsDelegate { public String createTarget( String targetContent ) throws TargetWsException { this.logger.finer( "Creating a new target." ); WebResource path = this.resource.path( UrlConstants.TARGETS ); ClientResponse response = this.wsClient.createBuilder( path ).post( ClientResponse.class, targetContent ); handleResponse( response ); return response.getEntity( String.class ); } TargetWsDelegate( WebResource resource, WsClient wsClient ); }
TargetWsDelegate { public String createTarget( String targetContent ) throws TargetWsException { this.logger.finer( "Creating a new target." ); WebResource path = this.resource.path( UrlConstants.TARGETS ); ClientResponse response = this.wsClient.createBuilder( path ).post( ClientResponse.class, targetContent ); handleResponse( response ); return response.getEntity( String.class ); } TargetWsDelegate( WebResource resource, WsClient wsClient ); List<TargetWrapperDescriptor> listAllTargets(); String createTarget( String targetContent ); void deleteTarget( String targetId ); void associateTarget( AbstractApplication app, String instancePathOrComponentName, String targetId, boolean bind ); }
TargetWsDelegate { public String createTarget( String targetContent ) throws TargetWsException { this.logger.finer( "Creating a new target." ); WebResource path = this.resource.path( UrlConstants.TARGETS ); ClientResponse response = this.wsClient.createBuilder( path ).post( ClientResponse.class, targetContent ); handleResponse( response ); return response.getEntity( String.class ); } TargetWsDelegate( WebResource resource, WsClient wsClient ); List<TargetWrapperDescriptor> listAllTargets(); String createTarget( String targetContent ); void deleteTarget( String targetId ); void associateTarget( AbstractApplication app, String instancePathOrComponentName, String targetId, boolean bind );  }