Examples of PersonFindResponse


Examples of org.springbyexample.schema.beans.person.PersonFindResponse

        testPersonOne(person);
    }

    @Test
    public void testFindByLastName() {
        PersonFindResponse response = service.findByLastName(LAST_NAME);
        List<Person> results = response.getResults();
       
        int expectedCount = 1;

        assertNotNull("Person list is null.", results);
        assertEquals("Number of persons should be " + expectedCount + ".", expectedCount, results.size());
       
        Person person = response.getResults().get(0);
       
        testPersonOne(person);
    }
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

        testPersonOne(person);
    }
   
    @Test
    public void testFind() {
        PersonFindResponse response = service.find();
        assertNotNull("Person response is null.", response);
       
        Collection<Person> persons = response.getResults();

        assertNotNull("Person list is null.", persons);
        assertEquals("Number of persons should be " + EXPECTED_COUNT + ".", EXPECTED_COUNT, persons.size());
       
        for (Person person : persons) {
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

       
        // test saved person
        testPerson(person,
                   firstName, lastName);

        PersonFindResponse findResponse = service.find();
        assertNotNull("Person response is null.", findResponse);
       
        Collection<Person> persons = findResponse.getResults();

        int expectedCount = EXPECTED_COUNT + 1;
       
        assertNotNull("Person list is null.", persons);
        assertEquals("Number of persons should be " + expectedCount + ".", expectedCount, persons.size());
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

    @RequestMapping(value = FIND_PAGINATED_REQUEST, method = RequestMethod.GET)
    public PersonFindResponse find(@PathVariable(PAGE_VAR) int page,
                                   @PathVariable(PAGE_SIZE_VAR) int pageSize) {
        logger.info("Find person page.  page={}  pageSize={}", page, pageSize);

        return new PersonFindResponse()
                    .withCount(2)
                    .withResults(new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME),
                                 new Person().withId(SECOND_ID).withFirstName(SECOND_FIRST_NAME).withLastName(SECOND_LAST_NAME));
    }
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

    @Override
    @RequestMapping(value = FIND_REQUEST, method = RequestMethod.GET)
    public PersonFindResponse find() {
        logger.info("Find all persons.");

        return new PersonFindResponse()
                    .withCount(2)
                    .withResults(new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME),
                                 new Person().withId(SECOND_ID).withFirstName(SECOND_FIRST_NAME).withLastName(SECOND_LAST_NAME));
    }
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

    @Test
    public void testPaginatedFind() {
        int page = 0;
        int pageSize = 2;
       
        PersonFindResponse response = client.find(page, pageSize);
        assertNotNull("Response is null.", response);
       
        int expectedCount = 2;
        assertEquals("count", expectedCount, response.getCount());
       
        assertNotNull("Response results is null.", response.getResults());
        verifyRecord(response.getResults().get(0));
    }
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

        verifyRecord(response.getResults().get(0));
    }

    @Test
    public void testFind() {
        PersonFindResponse response = client.find();
        assertNotNull("Response is null.", response);

        int expectedCount = 2;
        assertEquals("count", expectedCount, response.getCount());
       
        assertNotNull("Response results is null.", response.getResults());
        verifyRecord(response.getResults().get(0));
    }
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

        assertNull("'createUser' isn't null", record.getCreateUser());
    }

    @Test
    public void testFindByLastName() {
        PersonFindResponse response = client.findByLastName(LAST_NAME);
       
        assertNotNull("Response is null.", response);
       
        List<Person> results = response.getResults();
       
        int expectedCount = 1;

        assertNotNull("Person list is null.", results);
        assertEquals("Number of persons should be " + expectedCount + ".", expectedCount, results.size());
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

        verifyRecord(results.get(0));
    }

    @Test
    public void testSmallFindByLastName() {
        PersonFindResponse response = client.smallFindByLastName(LAST_NAME);
       
        assertNotNull("Response is null.", response);
       
        List<Person> results = response.getResults();
       
        int expectedCount = 1;
       
        assertNotNull("Person list is null.", results);
        assertEquals("Number of persons should be " + expectedCount + ".", expectedCount, results.size());
View Full Code Here

Examples of org.springbyexample.schema.beans.person.PersonFindResponse

    @Test
    public void testSmallPaginatedFind() {
        int page = 0;
        int pageSize = 2;
       
        PersonFindResponse response = client.smallFind(page, pageSize);
        assertNotNull("Response is null.", response);
       
        assertEquals("count", expectedCount, response.getCount());
       
        assertNotNull("Response results is null.", response.getResults());
        verifySmallRecord(response.getResults().get(0), false);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.