use of com.hack23.cia.service.api.action.admin.RefreshDataViewsResponse in project cia by Hack23.
the class RefreshDataViewsService method processService.
@Override
@Secured({ "ROLE_ADMIN" })
public RefreshDataViewsResponse processService(final RefreshDataViewsRequest serviceRequest) {
final RefreshDataViewsResponse inputValidation = inputValidation(serviceRequest);
if (inputValidation != null) {
return inputValidation;
}
final CreateApplicationEventRequest eventRequest = createApplicationEventForService(serviceRequest);
final UserAccount userAccount = getUserAccountFromSecurityContext();
if (userAccount != null) {
eventRequest.setUserId(userAccount.getUserId());
}
final RefreshDataViewsResponse response = new RefreshDataViewsResponse(ServiceResult.SUCCESS);
viewDataManager.refreshViews();
eventRequest.setApplicationMessage(response.getResult().toString());
createApplicationEventService.processService(eventRequest);
return response;
}
use of com.hack23.cia.service.api.action.admin.RefreshDataViewsResponse in project cia by Hack23.
the class RefreshDataViewsServiceITest method Test.
/**
* Test.
*
* @throws Exception
* the exception
*/
@Test
public void Test() throws Exception {
setAuthenticatedAdminuser();
final CreateApplicationSessionRequest createSessionRequest = createTestApplicationSession();
final RefreshDataViewsRequest serviceRequest = new RefreshDataViewsRequest();
serviceRequest.setSessionId(createSessionRequest.getSessionId());
final RefreshDataViewsResponse response = (RefreshDataViewsResponse) applicationManager.service(serviceRequest);
assertNotNull(EXPECT_A_RESULT, response);
assertEquals(EXPECT_SUCCESS, ServiceResult.SUCCESS, response.getResult());
}
Aggregations