@Test
public void testGetWhenAclIsInvalid()
{

    // Given
    final Map<String, String> anyUrlParameters = new HashMap<>();
    final OrderParams anyOrderParams = new OrderParams();
    final User anyUser = new User();
    final Set<Class<? extends BaseDimensionalItemObject>> targetEntities = new HashSet<>(
        asList( Indicator.class ) );
    final boolean invalidAcl = false;
    // Then
    expectedException.expect( IllegalQueryException.class );
    expectedException
        .expectMessage( containsString( "does not have read access for object" ) );
    // When
    when( dataItemServiceFacade.extractTargetEntities( anyList() ) ).thenReturn( targetEntities );
    when( aclService.canRead( anyUser, Indicator.class ) ).thenReturn( invalidAcl );
    dataItemQueryController.getJson( anyUrlParameters, anyOrderParams, anyUser );
}