Examples of ExtraServiceTO


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

        } catch (IllegalArgumentException ex) {
            // ok
        }
       
        ExtraService es = newService("Window cleaning", "Thorough window and mirror cleaning", BigDecimal.valueOf(22.2));
        ExtraServiceTO esto = mapper.map(es, ExtraServiceTO.class);
        try {
            service.update(esto);
            fail("exception should be thrown");
        } catch (IllegalArgumentException ex) {
            // ok
        }
        try {
            service.remove(esto);
            fail("exception should be thrown");
        } catch (IllegalArgumentException ex) {
            // ok
        }
        esto.setId(1L);
        try {
            service.create(esto);
            fail("exception should be thrown");
        } catch (IllegalArgumentException ex) {
            // ok
View Full Code Here

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

    }

    @Test
    public void testCreate() {
        final ExtraService es = newService("Window cleaning", "Thorough window and mirror cleaning", BigDecimal.valueOf(22.2));
        ExtraServiceTO esto = mapper.map(es, ExtraServiceTO.class);
        //
        service.create(esto);
        verify(dao).create(argThat(new BaseMatcher<ExtraService>() {

            @Override
View Full Code Here

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

    @Test
    public void testUpdate() {
        ExtraService es = newService("Window cleaning", "Thorough window and mirror cleaning", BigDecimal.valueOf(22.2));
        es.setId(2L);
        ExtraServiceTO esto = mapper.map(es, ExtraServiceTO.class);
        //
        service.update(esto);
        verify(dao).update(es);
    }
View Full Code Here

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

   
    @Test
    public void testGet() {
        ExtraService es = newService("Window cleaning", "Thorough window and mirror cleaning", BigDecimal.valueOf(22.2));
        es.setId(2L);
        ExtraServiceTO esto = mapper.map(es, ExtraServiceTO.class);
        //
        when(dao.get(2L)).thenReturn(es);
        ExtraServiceTO estoNew = service.get(2L);
        //
        assertEquals(estoNew, esto);
    }
View Full Code Here

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

    @Test
    public void testRemove() {
        ExtraService es = newService("Window cleaning", "Thorough window and mirror cleaning", BigDecimal.valueOf(22.2));
        es.setId(2L);
        ExtraServiceTO esto = mapper.map(es, ExtraServiceTO.class);
        //
        service.remove(esto);
        verify(dao).remove(es);
    }
View Full Code Here

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

        BigDecimal price = BigDecimal.ZERO;
        //
        Set<ExtraServiceTO> exSs = new HashSet<>();
        if (wrapper.getExtraServiceIds() != null) {
            for (Long l : order.getExtraServiceIds()) {
                ExtraServiceTO esto = esService.get(l);
                if (esto != null && esto.getPrice() != null) {
                    price = price.add(esto.getPrice());
                    exSs.add(esto);
                }
            }
        }
       
View Full Code Here

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

        return es;
    }
   
    @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
    public @ResponseBody ExtraServiceTO delete(@PathVariable("id") Long id, HttpServletResponse resp) {
        ExtraServiceTO 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.