Package org.happyfaces.domain

Examples of org.happyfaces.domain.Customer


        databaseTester.onTearDown();
    }

    @Test
    public void testFindById() {
        Customer customer = customerService.findById(1L);
        Assert.assertEquals("tele2@aaa.com", customer.getEmail());
    }
View Full Code Here


    @Test
    public void testCrud() throws Exception {
        databaseTester.onTearDown(); // crear db before tests
        // CREATE
        Assert.assertEquals(0, customerService.count());
        Customer customer = new Customer();
        customer.setName("Name");
        customer.setEmail("a@a.com");
        customer.setAddress("address");
        customer.setPhone("111333444");
       
        customerService.add(customer);
        Assert.assertEquals(1, customerService.count());

        // READ
        Customer readcustomer = customerService.list().get(0);
        Assert.assertEquals(readcustomer.getName(), "Name");
        Assert.assertEquals(readcustomer.getEmail(), "a@a.com");
        Assert.assertEquals(readcustomer.getAddress(), "address");
        Assert.assertEquals(readcustomer.getPhone(), "111333444");

        // UPDATE
        readcustomer.setName("updatedName");

        customerService.update(readcustomer);

        Customer updatedCustomer = customerService.list().get(0);
        Assert.assertEquals(updatedCustomer.getName(), "updatedName");

        // DELETE
        customerService.delete(updatedCustomer.getId());
        Assert.assertEquals(0, customerService.count());
    }
View Full Code Here

     * Return customer information. Load by customer id that are passed in parameters.
     */
    @RequestMapping(value = "/customer/{customeriId}", produces = "application/json", method = RequestMethod.GET)
    public ResponseEntity<CustomerDTO> getByJediIdAndGirId(@PathVariable("customeriId") Long customeriId) {

        Customer customer = customerService.findById(customeriId);

        if (customer == null) {
            throw new EntityNotFoundException();
        }

View Full Code Here

TOP

Related Classes of org.happyfaces.domain.Customer

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.