Search in sources :

Example 6 with Person

use of io.servicecomb.demo.compute.Person in project java-chassis by ServiceComb.

the class CodeFirstRestTemplate method testCodeFirstSayHello.

protected void testCodeFirstSayHello(RestTemplate template, String cseUrlPrefix) {
    Map<String, String> persionFieldMap = new HashMap<>();
    persionFieldMap.put("name", "person name from map");
    Person result = template.postForObject(cseUrlPrefix + "sayhello", persionFieldMap, Person.class);
    TestMgr.check("hello person name from map", result);
    Person input = new Person();
    input.setName("person name from Object");
    result = template.postForObject(cseUrlPrefix + "sayhello", input, Person.class);
    TestMgr.check("hello person name from Object", result);
}
Also used : HashMap(java.util.HashMap) Person(io.servicecomb.demo.compute.Person)

Aggregations

Person (io.servicecomb.demo.compute.Person)6 HttpEntity (org.springframework.http.HttpEntity)3 HttpHeaders (org.springframework.http.HttpHeaders)3 HashMap (java.util.HashMap)2