use of org.cloudfoundry.credhub.audit.RequestUuid in project credhub by cloudfoundry-incubator.
the class AuditInterceptorTest method setup.
@Before
public void setup() {
requestAuditRecordDataService = mock(RequestAuditRecordDataService.class);
securityEventsLogService = mock(SecurityEventsLogService.class);
auditLogFactory = mock(AuditLogFactory.class);
userContextFactory = mock(UserContextFactory.class);
userContext = mock(UserContext.class);
requestUuid = new RequestUuid();
subject = new AuditInterceptor(requestAuditRecordDataService, securityEventsLogService, auditLogFactory, userContextFactory);
request = mock(HttpServletRequest.class);
response = mock(HttpServletResponse.class);
final Authentication authentication = mock(Authentication.class);
when(request.getUserPrincipal()).thenReturn(authentication);
userContext = mock(UserContext.class);
when(userContextFactory.createUserContext(any())).thenReturn(userContext);
when(userContext.getActor()).thenReturn("user");
}
Aggregations