use of org.apache.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class PojoClient method testCommonInvoke.
@SuppressWarnings({ "deprecation" })
private static void testCommonInvoke(String transport) {
Map<String, Object> arguments = new HashMap<>();
arguments.put("index", 2);
arguments.put("user", new User());
Object result = InvokerUtils.syncInvoke("pojo", "server", "splitParam", arguments);
TestMgr.check("User [name=nameA, users count:0, age=100, index=2]", result);
arguments = new HashMap<>();
arguments.put("index", 3);
arguments.put("user", new User());
result = InvokerUtils.syncInvoke("pojo", "0.0.4", transport, "server", "splitParam", arguments);
TestMgr.check("User [name=nameA, users count:0, age=100, index=3]", result);
}
use of org.apache.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class PojoClient method testSplitParam.
private static void testSplitParam(Test test) {
User result = test.splitParam(1, new User());
LOGGER.info("split param result:{}", result);
TestMgr.check("User [name=nameA, users count:0, age=100, index=1]", result);
}
use of org.apache.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class CodeFirstJaxrs method cseResponse.
@ApiResponse(code = 200, response = User.class, message = "")
@ResponseHeaders({ @ResponseHeader(name = "h1", response = String.class), @ResponseHeader(name = "h2", response = String.class) })
@Path("/cseResponse")
@GET
public Response cseResponse(InvocationContext c1) {
Response response = Response.createSuccess(Status.ACCEPTED, new User());
response.setHeader("h1", "h1v " + c1.getContext().get(Const.SRC_MICROSERVICE));
InvocationContext c2 = ContextUtils.getInvocationContext();
response.setHeader("h2", "h2v " + c2.getContext().get(Const.SRC_MICROSERVICE));
return response;
}
use of org.apache.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class SpringMvcIntegrationTestBase method userOfNames.
private User userOfNames(String... names) {
User user1 = new User();
user1.setNames(names);
return user1;
}
use of org.apache.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class CodeFirstJaxrs method response.
@ApiResponse(code = 200, response = User.class, message = "")
@ResponseHeaders({ @ResponseHeader(name = "h1", response = String.class), @ResponseHeader(name = "h2", response = String.class) })
@Path("/response")
@GET
public Response response(InvocationContext c1) {
Response response = Response.createSuccess(Status.ACCEPTED, new User());
response.addHeader("h1", "h1v " + c1.getContext().toString());
InvocationContext c2 = ContextUtils.getInvocationContext();
response.addHeader("h2", "h2v " + c2.getContext().toString());
return response;
}
Aggregations