HibernateOrganizationDefinitionDao extends HibernateDaoSupport implements OrganizationDefinitionDao { public OrganizationDefinition getOrganizationDefinition(String id) { LOGGER.debug("get OrganizationDefinition(id = \"{}\")", id); OrganizationDefinition organizationDefinition = (OrganizationDefinition) getHibernateTemplate().get(OrganizationDefinition.class, id); LOGGER.debug("get OrganizationDefinition(id = \"{}\") = {}", id, organizationDefinition); return organizationDefinition; }  OrganizationDefinition getOrganizationDefinition(String id);  }
@Test public void testReadSucceeds() throws Exception { OrganizationDefinition organization00000000 = dao.getOrganizationDefinition("00000000"); assertNotNull(organization00000000); assertTrue(organization00000000.isValid()); assertEquals("00000000", organization00000000.getId()); assertEquals("Organization A", organization00000000.getName()); assertEquals(2, organization00000000.getSystems().size()); SystemDefinition systemA0 = organization00000000.getSystemDefinition("00000000"); assertNotNull(systemA0); assertTrue(systemA0.isValid()); assertEquals("00000000", systemA0.getId()); assertEquals("System A0", systemA0.getName()); assertEquals(true, systemA0.isStandard()); assertEquals(1, systemA0.getServices().size()); assertEquals(organization00000000, systemA0.getOrganization()); ServiceDefinition serviceA0_0 = systemA0.getServiceDefinition("00000000"); assertNotNull(serviceA0_0); assertTrue(serviceA0_0.isValid()); assertEquals("00000000", serviceA0_0.getId()); assertEquals("Service A0-0", serviceA0_0.getName()); assertEquals("M1", serviceA0_0.getRequestMessageTypeId()); assertEquals("M2", serviceA0_0.getResponseMessageTypeId()); assertNull(serviceA0_0.getServiceProviderBeanId()); assertEquals(systemA0, serviceA0_0.getSystem()); OrganizationDefinition organization00000001 = dao.getOrganizationDefinition("00000001"); assertNotNull(organization00000001); assertTrue(organization00000001.isValid()); assertEquals("00000001", organization00000001.getId()); assertEquals("Organization B", organization00000001.getName()); assertEquals(2, organization00000000.getSystems().size()); }
@Test public void testReadFails() throws Exception { OrganizationDefinition organization00000002 = dao.getOrganizationDefinition("00000002"); assertNull(organization00000002); }