Examples of CustomerTO


Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

    @Test
    public void testGet() {
        customer.setId(1L);
        customerTO.setId(1L);
        when(dao.get(1L)).thenReturn(customer);
        CustomerTO ct = service.get(1L);
       
        assertEquals(ct, customerTO);
    }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

    }
   
    public Resolution findByCustomer() {
        try {
            Long id = Long.parseLong(getContext().getRequest().getParameter("customerId"));
            CustomerTO customer = custService.get(id);
            if (customer != null) {
                result = service.findByCustomer(customer);
            }
        } catch (NumberFormatException ex) {
            result = new ArrayList<>();
View Full Code Here

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

    public CustomerTO getByUsername(String username) {
        if (username == null || username.equals("")) {
            throw new IllegalArgumentException("null or empty username");
        }
        Customer customer = dao.getByUsername(username);
        CustomerTO customerTO = mapper.map(customer, CustomerTO.class);
        return customerTO;
    }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

    public CustomerUserTO getByCustomerId(Long id) {
        if (id == null) {
            throw new IllegalArgumentException("id is null");
        }
       
        CustomerTO cto = cservice.get(id);
        UserTO uto = cto.getUser();       
        return new CustomerUserTO(cto, uto);
    }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

        if (customerUserTO.getUser().getId() == null) {
            throw new IllegalArgumentException("user.id is null");
        }
       
        UserTO userTO = customerUserTO.getUser();       
        CustomerTO customerTO = customerUserTO.getCustomer();       
       
        customerTO.setUser(userTO);      
        uservice.update(userTO);
        cservice.update(customerTO);
    }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

    }

    @Override
    public CustomerUserTO getByUsername(String username) {
        UserTO userTO = uservice.getByUsername(username);       
        CustomerTO customerTO = cservice.getByUsername(username);
       
        return new CustomerUserTO(customerTO, userTO);
    }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.dto.CustomerTO

        customerTO.setUser(userTO)
               
        User user2 = createUser("ferko22", "bak!s$#", false);
        UserTO userTO2 = mapper.map(user2, UserTO.class);       
        Customer customer2 = createCustomer(null, "Petko", "Mravcek", "Teplicka nad Vahom 142", "772222222");
        CustomerTO customerTO2 = mapper.map(customer2, CustomerTO.class);       
        CustomerUserTO customerUserTO2 = new CustomerUserTO(customerTO2, userTO2);
        customerTO2.setUser(userTO2)
       
        List<CustomerTO> customerList = new ArrayList<>();
        customerList.add(customerTO);
        customerList.add(customerTO2);
       
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.