Examples of ExtraService


Examples of cz.muni.fi.pa165.stis.entity.ExtraService

            fail("exception should be thrown");
        } 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) {
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

        }
    }

    @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
            public boolean matches(Object item) {
                if (!(item instanceof ExtraService)) {
                    return false;
                }
                final ExtraService other = (ExtraService) item;
                if (!Objects.equals(es.getId(), other.getId())) {
                    return false;
                }
                if (!Objects.equals(es.getName(), other.getName())) {
                    return false;
                }
                if (!Objects.equals(es.getDescription(), other.getDescription())) {
                    return false;
                }
                if (es.getPrice().compareTo(other.getPrice()) != 0) {
                    return false;
                }
                return true;
            }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

        }));
    }

    @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.entity.ExtraService

        verify(dao).update(es);
    }
   
    @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);
        //
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

        assertEquals(estoNew, esto);
    }

    @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.entity.ExtraService

        verify(dao).remove(es);
    }

    @Test
    public void testFindAll() {
        ExtraService es1 = newService("1", "2", BigDecimal.ZERO);
        es1.setId(2L);
        ExtraService es2 = newService("3", "5", BigDecimal.ONE);
        es2.setId(3L);
        List<ExtraService> extraServices = Arrays.asList(new ExtraService[]{es1, es2});
        List<ExtraServiceTO> esTOs = Arrays.asList(new ExtraServiceTO[]{
            mapper.map(es1, ExtraServiceTO.class),
            mapper.map(es2, ExtraServiceTO.class)
        });
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

        assertTrue(ess.containsAll(esTOs) && esTOs.containsAll(ess));
    }

    @Test
    public void testFindByName() {
        ExtraService es1 = newService("as1", "2", BigDecimal.ZERO);
        es1.setId(2L);
        ExtraService es2 = newService("as1", "5", BigDecimal.ONE);
        es2.setId(3L);
        List<ExtraService> extraServices = Arrays.asList(new ExtraService[]{es1, es2});
        List<ExtraServiceTO> esTOs = Arrays.asList(new ExtraServiceTO[]{
            mapper.map(es1, ExtraServiceTO.class),
            mapper.map(es2, ExtraServiceTO.class)
        });
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

        //
        assertTrue(ess.containsAll(esTOs) && esTOs.containsAll(ess));
    }
   
    private static ExtraService newService(String name, String description, BigDecimal price) {
        ExtraService es = new ExtraService();
        es.setName(name);
        es.setDescription(description);
        es.setPrice(price);
       
        return es;
    }
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

        ReflectionTestUtils.setField(orderService, "mapper", mapper);
       
        customer = newCustomer("Jozin", "Zbazin", "Baziny 22", "005544");
        customer.setId(1L);
        //
        ExtraService es1 = newExtraService("Umytie", "Umytie okien a zrkadiel", BigDecimal.valueOf(22.2));
        es1.setId(1L);
        ExtraService es2 = newExtraService("Vysavanie", "Vysavanie auta", BigDecimal.valueOf(122.5));
        es2.setId(2L);
        extraServices = new HashSet<ExtraService>(Arrays.asList(new ExtraService[]{es1, es2}));
        //
        Tyre t1 = newTyre(17D, "MM22", "EZ256", "Michellin", BigDecimal.valueOf(222));
        t1.setId(1L);
        Tyre t2 = newTyre(17D, "MM23", "EZ257", "Michellin", BigDecimal.valueOf(222));
View Full Code Here

Examples of cz.muni.fi.pa165.stis.entity.ExtraService

       
        return t;
    }
   
    private static ExtraService newExtraService(String name, String desc, BigDecimal price) {
        ExtraService es = new ExtraService();
        es.setName(name);
        es.setDescription(desc);
        es.setPrice(price);
       
        return es;
    }
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.