use of org.apache.servicecomb.demo.server.User in project incubator-servicecomb-java-chassis by apache.
the class PojoIntegrationTestBase method remoteTestPojo_splitParam.
@Test
public void remoteTestPojo_splitParam() {
User result = PojoService.test.splitParam(1, new User());
assertThat(result.toString(), is("User [name=nameA, users count:0, age=100, index=1]"));
}
use of org.apache.servicecomb.demo.server.User in project incubator-servicecomb-java-chassis by apache.
the class PojoIntegrationTestBase method remoteCodeFirstPojo_testUserMap.
@Test
public void remoteCodeFirstPojo_testUserMap() {
User user1 = new User();
user1.setNames(new String[] { "u1", "u2" });
User user2 = new User();
user2.setNames(new String[] { "u3", "u4" });
Map<String, User> userMap = new HashMap<>();
userMap.put("u1", user1);
userMap.put("u2", user2);
Map<String, User> result = PojoService.codeFirst.testUserMap(userMap);
assertThat(result.get("u1").getNames()[0], is("u1"));
assertThat(result.get("u1").getNames()[1], is("u2"));
assertThat(result.get("u2").getNames()[0], is("u3"));
assertThat(result.get("u2").getNames()[1], is("u4"));
}
use of org.apache.servicecomb.demo.server.User in project incubator-servicecomb-java-chassis by apache.
the class JaxrsIntegrationTestBase 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 incubator-servicecomb-java-chassis by apache.
the class CodeFirstSpringmvcBase method cseResponse.
public Response cseResponse(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;
}
use of org.apache.servicecomb.demo.server.User in project incubator-servicecomb-java-chassis by apache.
the class CodeFirstPojoClient method testCodeFirstUserMap.
private void testCodeFirstUserMap(CodeFirstPojoIntf codeFirst) {
User user1 = new User();
user1.setNames(new String[] { "u1", "u2" });
User user2 = new User();
user2.setNames(new String[] { "u3", "u4" });
Map<String, User> userMap = new HashMap<>();
userMap.put("u1", user1);
userMap.put("u2", user2);
Map<String, User> result = codeFirst.testUserMap(userMap);
TestMgr.check("u1", result.get("u1").getNames()[0]);
TestMgr.check("u2", result.get("u1").getNames()[1]);
TestMgr.check("u3", result.get("u2").getNames()[0]);
TestMgr.check("u4", result.get("u2").getNames()[1]);
userMap = new HashMap<>();
userMap.put("u1", user1);
userMap.put("u2", null);
result = codeFirst.testUserMap(userMap);
TestMgr.check(result.get("u1").getNames()[0], "u1");
TestMgr.check(result.get("u1").getNames()[1], "u2");
TestMgr.check(result.get("u2"), null);
}
Aggregations