Examples of PersonResponse


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

        assertEquals("Number of persons should be " + expectedCount + ".", expectedCount, persons.size());
    }

    @Test
    public void testUpdate() {
        PersonResponse response = service.findById(FIRST_ID);
        assertNotNull("Person response is null.", response);
       
        Person person = response.getResults();
       
        testPersonOne(person);
       
        String lastName = "Jones";
        person.setLastName(lastName);

        service.update(person);

        response = service.findById(FIRST_ID);
        assertNotNull("Person response is null.", response);
       
        person = response.getResults();
       
        testPersonOne(person, lastName);
    }
View Full Code Here

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

    @Test
    public void testDelete() {
        service.delete(new Person().withId(FIRST_ID));

        // person should be null after delete
        PersonResponse response = service.findById(FIRST_ID);
        assertNotNull("Person response is null.", response);
       
        Person person = response.getResults();

        assertNull("Person is not null.", person);
    }
View Full Code Here

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

        Person person = new Person();

        person.setFirstName(firstName);
        person.setLastName(lastName);
       
        PersonResponse response = service.create(person);
       
        return response;
    }
View Full Code Here

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

    @Override
    @RequestMapping(value = FIND_BY_ID_REQUEST, method = RequestMethod.GET)
    public PersonResponse findById(@PathVariable(ID_VAR) long id) {
        logger.info("Find person.  id={}", id);

        return new PersonResponse()
                    .withResult(new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME));
    }
View Full Code Here

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

    @Override
    @RequestMapping(value = SAVE_REQUEST, method = RequestMethod.POST)
    public PersonResponse save(@RequestBody Person request) {
        logger.info("Save person.  id={}", request.getId());

        return new PersonResponse().withMessageList(
                    new Message().withMessageType(MessageType.INFO)
                                 .withMessage(String.format("Successfully saved record.  id='%d'", request.getId())))
                    .withResult(request);
    }
View Full Code Here

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

    @Autowired
    private PersonClient client = null;

    @Test
    public void testFindById() {
        PersonResponse response = client.findById(ID);
       
        assertNotNull("Response is null.", response);
       
        verifyRecord(response.getResult());
    }
View Full Code Here

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

    @Test
    public void testSave() {
        Person request = new Person().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME);
       
        PersonResponse response = client.save(request);
       
        assertNotNull("Response is null.", response);
       
        verifyRecord(response.getResult());

        int expectedCount = 1;
        assertEquals("messageList.size", expectedCount, response.getMessageList().size());

        logger.info(response.getMessageList().get(0).getMessage());
    }
View Full Code Here

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

        verifySmallRecord(results.get(0), false);
    }

    @Test
    public void testSmallFindById() {
        PersonResponse response = client.smallFindById(id);
       
        assertNotNull("Response is null.", response);

        verifySmallRecord(response.getResults(), false);
    }
View Full Code Here

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

        return createFindResponse(results);
    }

    @Override
    protected PersonResponse createSaveResponse(Person result) {
        return new PersonResponse().withMessageList(new Message().withMessageType(MessageType.INFO)
                    .withMessage(getMessage(SAVE_MSG, new Object[] { result.getFirstName(), result.getLastName()})))
                    .withResults(result);
    }
View Full Code Here

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

                    .withResults(result);
    }

    @Override
    protected PersonResponse createDeleteResponse() {
        return new PersonResponse().withMessageList(new Message().withMessageType(MessageType.INFO)
                .withMessageKey(DELETE_MSG).withMessage(getMessage(DELETE_MSG)));
    }
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.