@Test
 public void testSaveMedicationStatusCode() {
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to initialize correctly",
       dod.getRandomMedicationStatusCode());
   MedicationStatusCode obj = dod.getNewTransientMedicationStatusCode(Integer.MAX_VALUE);
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to provide a new transient entity", obj);
   Assert.assertNull("Expected 'MedicationStatusCode' identifier to be null", obj.getId());
   medicationStatusCodeRepository.save(obj);
   medicationStatusCodeRepository.flush();
   Assert.assertNotNull(
       "Expected 'MedicationStatusCode' identifier to no longer be null", obj.getId());
 }
 @Test
 public void testDeleteMedicationStatusCode() {
   MedicationStatusCode obj = dod.getRandomMedicationStatusCode();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to initialize correctly", obj);
   Long id = obj.getId();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to provide an identifier", id);
   obj = medicationStatusCodeRepository.findOne(id);
   medicationStatusCodeRepository.delete(obj);
   medicationStatusCodeRepository.flush();
   Assert.assertNull(
       "Failed to remove 'MedicationStatusCode' with identifier '" + id + "'",
       medicationStatusCodeRepository.findOne(id));
 }
 @Test
 public void testFindMedicationStatusCode() {
   MedicationStatusCode obj = dod.getRandomMedicationStatusCode();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to initialize correctly", obj);
   Long id = obj.getId();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to provide an identifier", id);
   obj = medicationStatusCodeRepository.findOne(id);
   Assert.assertNotNull(
       "Find method for 'MedicationStatusCode' illegally returned null for id '" + id + "'", obj);
   Assert.assertEquals(
       "Find method for 'MedicationStatusCode' returned the incorrect identifier",
       id,
       obj.getId());
 }
 @Test
 public void testFlush() {
   MedicationStatusCode obj = dod.getRandomMedicationStatusCode();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to initialize correctly", obj);
   Long id = obj.getId();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to provide an identifier", id);
   obj = medicationStatusCodeRepository.findOne(id);
   Assert.assertNotNull(
       "Find method for 'MedicationStatusCode' illegally returned null for id '" + id + "'", obj);
   boolean modified = dod.modifyMedicationStatusCode(obj);
   Integer currentVersion = obj.getVersion();
   medicationStatusCodeRepository.flush();
   Assert.assertTrue(
       "Version for 'MedicationStatusCode' failed to increment on flush directive",
       (currentVersion != null && obj.getVersion() > currentVersion) || !modified);
 }
 @Test
 public void testUpdateMedicationStatusCodeUpdate() {
   MedicationStatusCode obj = dod.getRandomMedicationStatusCode();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to initialize correctly", obj);
   Long id = obj.getId();
   Assert.assertNotNull(
       "Data on demand for 'MedicationStatusCode' failed to provide an identifier", id);
   obj = medicationStatusCodeRepository.findOne(id);
   boolean modified = dod.modifyMedicationStatusCode(obj);
   Integer currentVersion = obj.getVersion();
   MedicationStatusCode merged = (MedicationStatusCode) medicationStatusCodeRepository.save(obj);
   medicationStatusCodeRepository.flush();
   Assert.assertEquals(
       "Identifier of merged object not the same as identifier of original object",
       merged.getId(),
       id);
   Assert.assertTrue(
       "Version for 'MedicationStatusCode' failed to increment on merge and flush directive",
       (currentVersion != null && obj.getVersion() > currentVersion) || !modified);
 }