@Test public void testDelete() { Bundle bundle = new Bundle(); bundle.setId(1); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().deleteBundle(request); assertTrue(response.getMessageList().isEmpty()); }
@Test public void testInsert() { Bundle bundle = new Bundle(); bundle.setCode(CODE_VALUE); bundle.setDescription(DESCRIPTION_VALUE); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, true, true); BundleResponse response = getBundleBAI().insertBundle(request); assertTrue(response.getMessageList().isEmpty()); }
@Test public void testInsertNoBundleDescription() { Bundle bundle = new Bundle(); bundle.setCode(CODE_VALUE); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().insertBundle(request); assertEquals(1, response.getMessageList().size()); assertEquals(BUNDLEDESC_REQUIRED, response.getMessageList().get(0).getMessageInfo().getCode()); }
@Test public void testDeleteException() { Bundle bundle = new Bundle(); bundle.setId(1); MockBundleBAC.setReturnResult(EXCEPTION); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().deleteBundle(request); assertEquals(1, response.getMessageList().size()); assertEquals(BAI_KEY, response.getMessageList().get(0).getMessageInfo().getCode()); }
@Test public void testUpdateNoBundleCode() { Bundle bundle = new Bundle(); bundle.setId(1); bundle.setDescription(DESCRIPTION_VALUE); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().updateBundle(request); assertEquals(1, response.getMessageList().size()); assertEquals(BUNDLECODE_REQUIRED, response.getMessageList().get(0).getMessageInfo().getCode()); }
@Test public void testInsertException() { Bundle bundle = new Bundle(); bundle.setCode(CODE_VALUE); bundle.setDescription(DESCRIPTION_VALUE); MockBundleBAC.setReturnResult(EXCEPTION); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().insertBundle(request); assertEquals(1, response.getMessageList().size()); assertEquals(BAI_KEY, response.getMessageList().get(0).getMessageInfo().getCode()); }
@Test public void testDeleteFailure() { Bundle bundle = new Bundle(); bundle.setId(1); MockBundleBAC.setReturnResult(FAILURE); MockBundleBAC.setFailureMessageCode(BAC_KEY); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().deleteBundle(request); assertEquals(1, response.getMessageList().size()); assertEquals(BAC_KEY, response.getMessageList().get(0).getMessageInfo().getCode()); }
@Test public void testUpdateFailure() { Bundle bundle = new Bundle(); bundle.setId(1); bundle.setCode(CODE_VALUE); bundle.setDescription(DESCRIPTION_VALUE); MockBundleBAC.setReturnResult(FAILURE); BundleMaintenanceRequest request = new BundleMaintenanceRequest(bundle, false, false); BundleResponse response = getBundleBAI().updateBundle(request); assertEquals(1, response.getMessageList().size()); assertEquals(BAC_KEY, response.getMessageList().get(0).getMessageInfo().getCode()); }