package tests;
import java.math.BigDecimal;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.cxf.jaxrs.client.WebClient;
import org.codehaus.jackson.map.ObjectMapper;
public class CommandExecutorClient {
public static void main(final String[] args) throws Exception {
// given
WebClient rsclient = WebClient.create("http://localhost:7070/next-app/services/rest", "admin", "admin", null);
ObjectMapper objectMapper = new ObjectMapper();
String writeValueAsString = objectMapper.writeValueAsString(new CustomerData("mirek", 27, BigDecimal.TEN));
// when
Response response =
rsclient.accept(MediaType.APPLICATION_JSON).type(MediaType.APPLICATION_JSON_TYPE).path(
"/command/execute/pl.com.stream.CustomerService/add").put(writeValueAsString);
}
}