use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class SavingsPrdBusinessServiceTest method testInvalidConnectionForGetApplicablePrdStatus.
@Test
@ExpectedException(value = ServiceException.class)
public void testInvalidConnectionForGetApplicablePrdStatus() throws PersistenceException {
try {
Short localeId = new Short("123");
when(prdOfferingPersistence.getApplicablePrdStatus(ProductType.SAVINGS, localeId)).thenThrow(new PersistenceException("some exception"));
service.getApplicablePrdStatus(localeId);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class CenterBOTest method testInvalidConnectionInConstructor.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInConstructor() throws PersistenceException {
try {
Short id = new Short("1");
OfficeBO office = mock(OfficeBO.class);
when(office.getOfficeId()).thenReturn(id);
when(customerPersistence.getCustomerCountForOffice(CustomerLevel.CENTER, id)).thenThrow(new PersistenceException("some exception"));
new CenterBO(mock(UserContext.class), "name", null, null, null, "externalId", null, office, mock(MeetingBO.class), mock(PersonnelBO.class), customerPersistence);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (CustomerException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class CheckListBusinessServiceTest method testInvalidConnectionRetrieveAllAccountCheckLists.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionRetrieveAllAccountCheckLists() throws PersistenceException {
try {
when(checkListPersistence.retreiveAllAccountCheckLists()).thenThrow(new PersistenceException("some exception"));
service.retreiveAllAccountCheckLists();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class CheckListBusinessServiceTest method testInvalidConnectionRetrieveAllCustomerCheckLists.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionRetrieveAllCustomerCheckLists() throws PersistenceException {
try {
when(checkListPersistence.retreiveAllCustomerCheckLists()).thenThrow(new PersistenceException("some exception"));
service.retreiveAllCustomerCheckLists();
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
use of org.springframework.test.annotation.ExpectedException in project head by mifos.
the class GroupBusinessServiceTest method testInvalidConnectionInGetGroup.
@Test
@ExpectedException(value = CustomerException.class)
public void testInvalidConnectionInGetGroup() throws PersistenceException {
try {
Integer customerId = new Integer(1);
when(groupPersistence.getGroupByCustomerId(customerId)).thenThrow(new PersistenceException("some exception"));
service.getGroup(customerId);
junit.framework.Assert.fail("should fail because of invalid session");
} catch (ServiceException e) {
}
}
Aggregations