HibernateServiceDefinitionDao extends HibernateDaoSupport implements ServiceDefinitionDao { public ServiceDefinition getServiceDefinition(String key) { LOGGER.debug("get ServiceDefinition(key = \"{}\")", key); ServiceDefinition serviceDefinition = (ServiceDefinition) getHibernateTemplate().get(ServiceDefinition.class, key); LOGGER.debug("get ServiceDefinition(key = \"{}\") = {}", key, serviceDefinition); return serviceDefinition; }  ServiceDefinition getServiceDefinition(String key); @SuppressWarnings("unchecked") ServiceDefinition getServiceDefinition(String systemKey, String serviceId); @SuppressWarnings("unchecked") ServiceDefinition getServiceDefinition(String organizationId, String systemId, String serviceId);  }
@Test public void testReadSucceeds() throws Exception { ServiceDefinition serviceA0_0 = dao.getServiceDefinition("00000000", "00000000", "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("00000000", serviceA0_0.getSystem().getId()); }
@Test public void testReadFails() throws Exception { ServiceDefinition service = dao.getServiceDefinition("00000000", "00000000", "00000003"); assertNull(service); }