GetMapLimitChecker { void checkLayerCount( final int requestedLayerCount, final Integer maxLayers ) throws OWSException { if ( maxLayers == null ) { return; } if ( requestedLayerCount > maxLayers ) { final String msg = "Too many layers requested. Maximum number of layers: " + maxLayers; throw new OWSException( msg, INVALID_PARAMETER_VALUE, "layer" ); } }  void checkRequestedSizeAndLayerCount( final GetMap request, final DeegreeWMS config );  }
@Test public void checkLayerCountInRange() throws OWSException { checker.checkLayerCount( 10, 10 ); }
@Test public void checkLayerCountTooLarge() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Too many layers requested. Maximum number of layers: 10" ); checker.checkLayerCount( 100, 10 ); }
@Test public void checkLayerCountNoLimit() throws OWSException { checker.checkLayerCount( 100, null ); }