Package org.springbyexample.schema.beans

Examples of org.springbyexample.schema.beans.Persons


     */
    @Test
    public void testStringDataPostMethodIgnoreResponse() {
        assertNotNull("HttpClientOxmTemplate is null.", template);

        Persons persons = new Persons();
       
        Person person = new Person();
        person.setId(ID);
        person.setFirstName(FIRST_NAME);
        person.setLastName(LAST_NAME);
       
        persons.getPerson().add(person);
       
        template.executePostMethod(persons);
    }
View Full Code Here


     */
    @Test
    public void testStringDataPostMethodWithStringResponse() {
        assertNotNull("HttpClientOxmTemplate is null.", template);

        Persons persons = new Persons();
       
        Person person = new Person();
        person.setId(ID);
        person.setFirstName(FIRST_NAME);
        person.setLastName(LAST_NAME);
       
        persons.getPerson().add(person);
       
        template.executePostMethod(persons,
            new ResponseCallback<Persons>() {
                public void doWithResponse(Persons persons) throws IOException {
                    assertNotNull("Persons result is null.", persons);
                    assertNotNull("Person list is null.", persons.getPerson());
   
                    int expectedCount = 1;
                   
                    assertEquals("Person list size should be '" + expectedCount + "'.", expectedCount, persons.getPerson().size());
                   
                    Person result = persons.getPerson().get(0);
                   
                    assertEquals("Person id should be '" + ID_RESULT + "'.", ID_RESULT, new Integer(result.getId()));
                    assertEquals("Person first name should be '" + FIRST_NAME_RESULT + "'.", FIRST_NAME_RESULT, result.getFirstName());
                    assertEquals("Person last name should be '" + LAST_NAME_RESULT + "'.", LAST_NAME_RESULT, result.getLastName());
   
View Full Code Here

TOP

Related Classes of org.springbyexample.schema.beans.Persons

Copyright © 2018 www.massapicom. 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.