@Test public void testRefillCardNoIdNoAmount() { CallingCardMaintenanceRequest request = new CallingCardMaintenanceRequest(); CommonTestRoutines.createDummyUserContext(request); CallingCardInfo callingCardInfo = new CallingCardInfo(); callingCardInfo.setModelAction(PersistanceActionEnum.UPDATE); request.setCallingCardInfo(callingCardInfo); Mockito.when(getMockCallingCardBAC().refillCard(request)) .thenReturn(returnInsert(callingCardInfo)); CallingCardMaintenanceResponse response = getCallingCardBAI().refillCard(request); assertEquals("", 2, response.getMessageList().size()); assertEquals( "", PROSPERITASGLOBAL_BASE_CALLINGCARDVALIDATOR_PERSON_ID_REQUIRED, response.getMessageList().get(0).getMessageInfo().getCode()); assertEquals( "", PROSPERITASGLOBAL_BASE_CALLINGCARDVALIDATOR_AMOUNT_REQUIRED, response.getMessageList().get(1).getMessageInfo().getCode()); }
@Test public void testAssignCardNoObject() { CallingCardMaintenanceRequest request = new CallingCardMaintenanceRequest(); CommonTestRoutines.createDummyUserContext(request); CallingCardMaintenanceResponse response = getCallingCardBAI().assignCard(request); assertEquals("", 1, response.getMessageList().size()); assertEquals( "", PROSPERITASGLOBAL_BASE_CALLINGCARDVALIDATOR_OBJECT_REQUIRED, response.getMessageList().get(0).getMessageInfo().getCode()); }
@Test public void testGetBalanceNoId() { CallingCardMaintenanceRequest request = new CallingCardMaintenanceRequest(); CommonTestRoutines.createDummyUserContext(request); CallingCardInfo callingCardInfo = new CallingCardInfo(); callingCardInfo.setModelAction(PersistanceActionEnum.INSERT); request.setCallingCardInfo(callingCardInfo); CallingCardMaintenanceResponse response = getCallingCardBAI().getCardBalance(request); assertEquals("", 1, response.getMessageList().size()); assertEquals( "", PROSPERITASGLOBAL_BASE_CALLINGCARDVALIDATOR_PERSON_ID_REQUIRED, response.getMessageList().get(0).getMessageInfo().getCode()); }