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());
}
Aggregations