Examples of TyreTO


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

        } catch (IllegalArgumentException ex) {
            // ok
        }
       
        Tyre t = createTyre(19D, "P Zero", "235/40ZR19", "Pirelli", BigDecimal.valueOf(450));
        TyreTO tto = mapper.map(t, TyreTO.class);
        try {
            service.update(tto);
            fail("exception should be thrown");
        } catch (IllegalArgumentException ex) {
            // ok
        }
        try {
            service.remove(tto);
            fail("exception should be thrown");
        } catch (IllegalArgumentException ex) {
            // ok
        }
        tto.setId(1L);
        try {
            service.create(tto);
            fail("exception should be thrown");
        } catch (IllegalArgumentException ex) {
             //ok
View Full Code Here

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

    }
   
    @Test
    public void testCreate() {
        final Tyre tyre = createTyre(19D, "P Zero", "235/40ZR19", "Pirelli", BigDecimal.valueOf(420));
        TyreTO tto = mapper.map(tyre, TyreTO.class);
       
        service.create(tto);
        verify(dao).create(argThat(new BaseMatcher<Tyre>() {

            @Override
View Full Code Here

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

    @Test
    public void testGet() {
        Tyre tyre = createTyre(19D, "P Zero", "235/40ZR19", "Pirelli", BigDecimal.valueOf(420));
        tyre.setId(4L);
        TyreTO tto = mapper.map(tyre, TyreTO.class);       
       
        when(dao.get(4L)).thenReturn(tyre);
        TyreTO tyreTO = service.get(4L);
        assertEquals(tyreTO, tto);
    }
View Full Code Here

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

   
    @Test
    public void testUpdate() {
        Tyre tyre = createTyre(19D, "P Zero", "235/40ZR19", "Pirelli", BigDecimal.valueOf(420));
        tyre.setId(2L);
        TyreTO tto = mapper.map(tyre, TyreTO.class);
       
        service.update(tto);
        verify(dao).update(tyre);       
    }
View Full Code Here

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

   
    @Test
    public void testRemove() {
        Tyre tyre = createTyre(19D, "P Zero", "235/40ZR19", "Pirelli", BigDecimal.valueOf(420));
        tyre.setId(2L);
        TyreTO tto = mapper.map(tyre, TyreTO.class);
       
        service.remove(tto);
        verify(dao).remove(tyre);       
    }
View Full Code Here

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

                if (em.getValue() == null) {
                    continue;
                }
                Long id = em.getValue().getId();
                if (id != null) {
                    TyreTO tto = tyres.get(id);
                    if (tto == null) {
                        tto = tyreService.get(id);
                        tyres.put(id, tto);
                    }
                    if (tto != null && tto.getPrice() != null) {
                        price = price.add(tto.getPrice());
                    }
                }
            }
        }
        wrapper.setExtraServices(exSs);
View Full Code Here

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

        return tyre;
    }
   
    @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
    public @ResponseBody TyreTO delete(@PathVariable("id") Long id, HttpServletResponse resp) {
        TyreTO to = service.get(id);
        if (to != null) {
            service.remove(to);
        } else {
            throw new IllegalArgumentException("resource not found");
        }
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.