use of org.motechproject.mds.test.domain.editablelookups.Entry in project motech by motech.
the class MdsDdeBundleIT method shouldLoadLookupsFromFile.
@Test
public void shouldLoadLookupsFromFile() {
Entry entryOne = new Entry();
entryOne.setValue("someValue");
entryDataService.create(entryOne);
Entry entryTwo = new Entry();
entryTwo.setValue("someValueTwo");
entryDataService.create(entryTwo);
EntityDto entity = entityService.getEntityByClassName("org.motechproject.mds.test.domain.editablelookups.Entry");
List<LookupDto> lookups = entityService.getEntityLookups(entity.getId());
assertEquals(1, lookups.size());
assertEquals("Find by Value", lookups.get(0).getLookupName());
Map<String, String> params = new HashMap<>();
params.put("value", entryOne.getValue());
List<Entry> lookupResult = lookupService.findMany(entity.getClassName(), lookups.get(0).getLookupName(), params);
assertEquals(1, lookupResult.size());
assertEquals(entryOne.getValue(), lookupResult.get(0).getValue());
}