GetMapLimitChecker { void checkHeight( final int requestedHeight, final Integer maxHeight ) throws OWSException { if ( requestedHeight <= 0 ) { final String msg = "Height must be positive."; throw new OWSException( msg, INVALID_PARAMETER_VALUE, "height" ); } if ( maxHeight == null ) { return; } if ( requestedHeight > maxHeight ) { final String msg = "Height out of range. Maximum height: " + maxHeight; throw new OWSException( msg, INVALID_PARAMETER_VALUE, "height" ); } }  void checkRequestedSizeAndLayerCount( final GetMap request, final DeegreeWMS config );  }
@Test public void checkHeightWithNegativeValue() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Height must be positive." ); checker.checkHeight( -1, null ); }
@Test public void checkHeightWithZero() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Height must be positive." ); checker.checkHeight( 0, null ); }
@Test public void checkHeightTooLarge() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Height out of range. Maximum height: 1024" ); checker.checkHeight( 1025, 1024 ); }
@Test public void checkHeightNoLimit() throws OWSException { checker.checkHeight( 1025, null ); }
@Test public void checkHeightInRange() throws OWSException { checker.checkHeight( 1024, 1024 ); }