@Test public void testFindByEcfIdAndVersion() { List<ApplicationEventFamilyMap> applicationEventFamilyMaps = generateApplicationEventFamilyMap(null, null, null, 2, true); ApplicationEventFamilyMap aefm = applicationEventFamilyMaps.get(0); List<ApplicationEventFamilyMap> found = applicationEventFamilyMapDao.findByEcfIdAndVersion(aefm.getEcf().getId().toString(), aefm.getVersion()); Assert.assertEquals(applicationEventFamilyMaps, found); } }
@Test public void findByTenantIdTest() { List<EventClassFamily> eventClassFamilies = generateEventClassFamily(null, 2); EventClassFamily dto = eventClassFamilyDao.findById(eventClassFamilies.get(0).getStringId()); Assert.assertNotNull(dto); List<EventClassFamily> eventClassFamilyList = eventClassFamilyDao.findByTenantId(dto.getTenant().getStringId()); EventClassFamily eventClassFamily = null; for (EventClassFamily found : eventClassFamilyList) { if (dto.getId().equals(found.getId())) { eventClassFamily = found; } } Assert.assertNotNull(eventClassFamily); Assert.assertEquals(dto, eventClassFamily); }
@Test public void testValidateApplicationEventFamilyMap() { List<ApplicationEventFamilyMap> applicationEventFamilyMaps = generateApplicationEventFamilyMap(null, null, null, 2, true); ApplicationEventFamilyMap aefm = applicationEventFamilyMaps.get(0); boolean result = applicationEventFamilyMapDao.validateApplicationEventFamilyMap(aefm.getApplication().getId().toString(), aefm.getEcf().getId() .toString(), aefm.getVersion()); Assert.assertFalse(result); result = applicationEventFamilyMapDao.validateApplicationEventFamilyMap("7", "7", 7); Assert.assertTrue(result); }
eventClassFamily.getSchemas()) { EcfInfoDto ecf = new EcfInfoDto(); ecf.setEcfId(String.valueOf(eventClassFamily.getId())); ecf.setEcfName(eventClassFamily.getName()); ecf.setVersion(eventClassFamilyVersion.getVersion());