Package org.fao.geonet.domain

Examples of org.fao.geonet.domain.HarvesterData


    @Autowired
    private HarvesterDataRepository _dataRepository;

    @Test
    public void testFindAllById_HarvesterUuid() throws Exception {
        final HarvesterData data1 = newHarvesterData(_inc);
        _dataRepository.save(data1);
        final HarvesterData data2 = newHarvesterData(_inc);
        _dataRepository.save(data2);
        final HarvesterData data3 = newHarvesterData(_inc);
        data3.getId().setHarvesterUuid(data1.getId().getHarvesterUuid());
        _dataRepository.save(data3);

        List<HarvesterData> found = _dataRepository.findAllById_HarvesterUuid(data1.getId().getHarvesterUuid());

        assertEquals(2, found.size());

        for (HarvesterData harvesterData : found) {
            assertEquals(data1.getId().getHarvesterUuid(), harvesterData.getId().getHarvesterUuid());
            if (harvesterData.getId().getKey().equals(data2.getId().getKey())) {
                fail("should not have found data2: "+data2);
            } else {
                final boolean equalsData1 = data1.equals(harvesterData);
                final boolean equalsData3 = data3.equals(harvesterData);
                assertTrue("Expected "+harvesterData+" to equals: "+data1+" or "+data3, equalsData1 || equalsData3);
            }
        }
    }
View Full Code Here


        }
    }

    public static HarvesterData newHarvesterData(AtomicInteger inc) {
        int id = inc.incrementAndGet();
        final HarvesterData data = new HarvesterData();
        data.setValue("value_"+id);
        data.setId(new HarvesterDataId("uuid_"+id, "key_"+id));

        return data;
    }
View Full Code Here

TOP

Related Classes of org.fao.geonet.domain.HarvesterData

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.