Search in sources :

Example 1 with AccessRequestWrapper

use of org.finra.gatekeeper.controllers.wrappers.AccessRequestWrapper in project Gatekeeper by FINRAOS.

the class AccessRequestServiceTest method testStoreAccessRequestDaysBeyondMax.

/**
 * Test for making sure the storeAccessRequest method throws an exception if a prod request for datafix . Makes sure the accessRequestRepository
 * is called and called with the correct object.
 */
@Test(expected = GatekeeperException.class)
public void testStoreAccessRequestDaysBeyondMax() throws GatekeeperException {
    List<User> users = new ArrayList<>();
    users.add(user);
    List<AWSRdsDatabase> instances = new ArrayList<>();
    instances.add(awsRdsDatabase);
    AccessRequestWrapper badReq = new AccessRequestWrapper();
    badReq.setAccountSdlc("prod");
    badReq.setDays(181);
    badReq.setRoles(Arrays.asList(new UserRole("dba")));
    AccessRequestCreationResponse result = accessRequestService.storeAccessRequest(badReq);
    verify(accessRequestRepository, times(0)).save((AccessRequest) result.getResponse());
}
Also used : AccessRequestWrapper(org.finra.gatekeeper.controllers.wrappers.AccessRequestWrapper) ActiveAccessRequestWrapper(org.finra.gatekeeper.controllers.wrappers.ActiveAccessRequestWrapper) CompletedAccessRequestWrapper(org.finra.gatekeeper.controllers.wrappers.CompletedAccessRequestWrapper) AccessRequestCreationResponse(org.finra.gatekeeper.services.accessrequest.model.response.AccessRequestCreationResponse) Test(org.junit.Test)

Aggregations

AccessRequestWrapper (org.finra.gatekeeper.controllers.wrappers.AccessRequestWrapper)1 ActiveAccessRequestWrapper (org.finra.gatekeeper.controllers.wrappers.ActiveAccessRequestWrapper)1 CompletedAccessRequestWrapper (org.finra.gatekeeper.controllers.wrappers.CompletedAccessRequestWrapper)1 AccessRequestCreationResponse (org.finra.gatekeeper.services.accessrequest.model.response.AccessRequestCreationResponse)1 Test (org.junit.Test)1