use of io.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class TestImpl method doTest.
private User doTest(int index, User user, List<User> users, byte[] data) {
if (user == null) {
user = new User();
}
user.setIndex(index);
int userCount = (users == null) ? 0 : users.size();
user.setName(user.getName() + ", users count:" + userCount);
return user;
}
use of io.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class PojoClient method testWrapParam.
private static void testWrapParam(Test test) {
User user = new User();
TestRequest request = new TestRequest();
request.setUser(user);
request.setIndex(0);
request.setData(buffer);
request.getUsers().add(user);
User result = test.wrapParam(request);
LOGGER.info("wrap param result:{}", result);
TestMgr.check("User [name=nameA, users count:1, age=100, index=0]", result);
}
use of io.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 io.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class CodeFirstSpringmvc method cseResponse.
@ApiResponse(code = 200, response = User.class, message = "")
@ResponseHeaders({ @ResponseHeader(name = "h1", response = String.class), @ResponseHeader(name = "h2", response = String.class) })
@RequestMapping(path = "/cseResponse", method = RequestMethod.GET)
public Response cseResponse() {
Response response = Response.createSuccess(Status.ACCEPTED, new User());
response.getHeaders().addHeader("h1", "h1v").addHeader("h2", "h2v");
return response;
}
use of io.servicecomb.demo.server.User in project java-chassis by ServiceComb.
the class CodeFirstRestTemplateSpringmvc method testIntf.
private void testIntf() {
ResponseEntity<User> responseEntity = intf.responseEntity();
TestMgr.check("User [name=nameA, age=100, index=0]", responseEntity.getBody());
TestMgr.check("h1v", responseEntity.getHeaders().getFirst("h1"));
TestMgr.check("h2v", responseEntity.getHeaders().getFirst("h2"));
checkStatusCode("springmvc", 202, responseEntity.getStatusCode());
Response cseResponse = intf.cseResponse();
TestMgr.check("User [name=nameA, age=100, index=0]", cseResponse.getResult());
TestMgr.check("h1v", cseResponse.getHeaders().getFirst("h1"));
TestMgr.check("h2v", cseResponse.getHeaders().getFirst("h2"));
}
Aggregations