Package org.springbyexample.schema.beans.person

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


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

        return new ProfessionalResponse()
                    .withResults(new Professional().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME)
                                                  .withCompanyName(COMPANY_NAME));
    }
View Full Code Here


    @Override
    @RequestMapping(value = SAVE_REQUEST, method = RequestMethod.POST)
    public ProfessionalResponse create(@RequestBody Professional request) {
        logger.info("Save Professional.  id={}", request.getId());

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

    public ProfessionalResponse update(@RequestBody Professional request) {
        Assert.isTrue((request.getId() 0), "Update should have a valid primary key");

        logger.info("Update person.  id={}", request.getId());

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

    @Override
    @RequestMapping(value = DELETE_PK_REQUEST, method = RequestMethod.DELETE)
    public ProfessionalResponse delete(@PathVariable(ID_VAR) Integer id) {
        logger.info("Delete Professional.  id={}", id);

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

        int id = request.getId();

        logger.info("Delete professional.  id={}", id);

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

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

        return new ProfessionalResponse()
                    .withResult(new Professional().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME)
                                                  .withCompanyName(COMPANY_NAME));
    }
View Full Code Here

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

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

    @Autowired
    private ProfessionalClient client = null;

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

    @Test
    public void testSave() {
        Professional request = new Professional().withId(ID).withFirstName(FIRST_NAME).withLastName(LAST_NAME)
                                                 .withCompanyName(COMPANY_NAME);
       
        ProfessionalResponse 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

TOP

Related Classes of org.springbyexample.schema.beans.person.ProfessionalResponse

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.