GetMapLimitChecker { void checkWidth( final int requestedWidth, final Integer maxWidth ) throws OWSException { if ( requestedWidth <= 0 ) { final String msg = "Width must be positive."; throw new OWSException( msg, INVALID_PARAMETER_VALUE, "width" ); } if ( maxWidth == null ) { return; } if ( requestedWidth > maxWidth ) { final String msg = "Width out of range. Maximum width: " + maxWidth; throw new OWSException( msg, INVALID_PARAMETER_VALUE, "width" ); } }  void checkRequestedSizeAndLayerCount( final GetMap request, final DeegreeWMS config );  }
@Test public void checkWidthWithNegativeValue() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Width must be positive." ); checker.checkWidth( -1, null ); }
@Test public void checkWidthWithZero() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Width must be positive." ); checker.checkWidth( 0, null ); }
@Test public void checkWidthTooLarge() throws OWSException { thrown.expect( OWSException.class ); thrown.expectMessage( "Width out of range. Maximum width: 1024" ); checker.checkWidth( 1025, 1024 ); }
@Test public void checkWidthNoLimit() throws OWSException { checker.checkWidth( 1025, null ); }
@Test public void checkWidthInRange() throws OWSException { checker.checkWidth( 1024, 1024 ); }