Package tests

Source Code of tests.CommandExecutorClient

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);

  }
}
TOP

Related Classes of tests.CommandExecutorClient

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.