when(cpf.externalIntegrationConnectionProviderFromId(sampleFeedConnection.getProviderId()))
.thenReturn(ConnectionProvidersForTests.RSS_PROVIDER);
ReflectionTestUtils.setField(inventoryService, "connectionProviderFactory", cpf);
SecurityService ssMock = Mockito.mock(SecurityService.class);
EventDAO edMock = Mockito.mock(EventDAO.class);
EventServiceImpl esImpl = new EventServiceImpl();
// Return null for the current user
Mockito.when(ssMock.getCurrentUser()).thenThrow(new AuthenticationException("A user must be logged in!"));