use of com.hack23.cia.service.api.action.admin.RemoveDataRequest.DataType in project cia by Hack23.
the class RemoveDataServiceITest method Test.
/**
* Test.
*
* @throws Exception
* the exception
*/
@Test
public void Test() throws Exception {
final RemoveDataManager removeDataManager = Mockito.mock(RemoveDataManager.class);
ReflectionTestUtils.setField(removeDataService, "removeDataManager", removeDataManager);
setAuthenticatedAdminuser();
final CreateApplicationSessionRequest createSessionRequest = createTestApplicationSession();
for (final DataType dataType : RemoveDataRequest.DataType.values()) {
final RemoveDataRequest serviceRequest = new RemoveDataRequest();
serviceRequest.setSessionId(createSessionRequest.getSessionId());
serviceRequest.setDataType(dataType);
final RemoveDataResponse response = (RemoveDataResponse) applicationManager.service(serviceRequest);
assertNotNull(EXPECT_A_RESULT, response);
assertEquals(EXPECT_SUCCESS, ServiceResult.SUCCESS, response.getResult());
}
Mockito.verify(removeDataManager).removeApplicationHistory();
Mockito.verify(removeDataManager).removeCommitteeProposals();
Mockito.verify(removeDataManager).removeDocuments();
Mockito.verify(removeDataManager).removeDocumentStatus();
Mockito.verify(removeDataManager).removePersonData();
}
use of com.hack23.cia.service.api.action.admin.RemoveDataRequest.DataType in project cia by Hack23.
the class RemoveDataClickListener method buttonClick.
@Override
public void buttonClick(final ClickEvent event) {
final RemoveDataRequest serviceRequest = new RemoveDataRequest();
serviceRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
serviceRequest.setDataType(dataType);
ApplicationMangerAccess.getApplicationManager().asyncService(serviceRequest);
Notification.show(DATA_REMOVED);
}
Aggregations