@Test(expected = ForbiddenException.class)
public void automationClientRejectsClientsWithoutAutomation() {

  Client clientWithoutAutomation =
      new Client(3423, "clientWithoutAutomation", null, null, null, null, null, null, null, null,
          true, false
      );
  when(securityContext.getUserPrincipal()).thenReturn(
      SimplePrincipal.of("CN=clientWithoutAutomation"));
  when(clientDAO.getClientByName("clientWithoutAutomation"))
      .thenReturn(Optional.of(clientWithoutAutomation));
  factory.provide(request, httpServletRequest);
}