test_class.declarator: responseMesssage = "Request size is larger than permissible limit. Request size is . . "
  			+ "where permissible limit is .*"
test_class.modifier: private static final
test_class.original_string: private static final String responseMesssage = "Request size is larger than permissible limit. Request size is . . "
  			+ "where permissible limit is .*";
test_class.type: String
test_class.var_name: responseMesssage
test_class.file: spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestSizeGatewayFilterFactoryTest.java
test_class.identifier: RequestSizeGatewayFilterFactoryTest
test_class.superclass: extends BaseWebClientTests
test_case.body: @Test
  	public void toStringFormat() {
  		RequestSizeConfig config = new RequestSizeConfig();
  		config.setMaxSize(DataSize.ofBytes(1000L));
  		GatewayFilter filter = new RequestSizeGatewayFilterFactory().apply(config);
  		assertThat(filter.toString()).contains("max").contains("1000");
  	}
test_case.class_method_signature: RequestSizeGatewayFilterFactoryTest.toStringFormat()
test_case.full_signature: @Test public void toStringFormat()
test_case.identifier: toStringFormat
test_case.invocations: setMaxSize ofBytes apply contains contains assertThat toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toStringFormat()
focal_class.declarator: PREFIX = "kMGTPE"
focal_class.modifier: private static
focal_class.original_string: private static String PREFIX = "kMGTPE";
focal_class.type: String
focal_class.var_name: PREFIX
focal_class.declarator: ERROR = "Request size is larger than permissible limit."
  			+ " Request size is %s where permissible limit is %s"
focal_class.modifier: private static
focal_class.original_string: private static String ERROR = "Request size is larger than permissible limit."
  			+ " Request size is %s where permissible limit is %s";
focal_class.type: String
focal_class.var_name: ERROR
focal_class.file: spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestSizeGatewayFilterFactory.java
focal_class.identifier: RequestSizeGatewayFilterFactory
focal_class.class_method_signature: RequestSizeGatewayFilterFactory.RequestSizeGatewayFilterFactory()
focal_class.full_signature: public  RequestSizeGatewayFilterFactory()
focal_class.identifier: RequestSizeGatewayFilterFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  RequestSizeGatewayFilterFactory()
focal_class.class_method_signature: RequestSizeGatewayFilterFactory.getErrorMessage(Long currentRequestSize, Long maxSize)
focal_class.full_signature: private static String getErrorMessage(Long currentRequestSize, Long maxSize)
focal_class.identifier: getErrorMessage
focal_class.modifiers: private static
focal_class.parameters: (Long currentRequestSize, Long maxSize)
focal_class.return: String
focal_class.signature: String getErrorMessage(Long currentRequestSize, Long maxSize)
focal_class.class_method_signature: RequestSizeGatewayFilterFactory.getReadableByteCount(long bytes)
focal_class.full_signature: private static String getReadableByteCount(long bytes)
focal_class.identifier: getReadableByteCount
focal_class.modifiers: private static
focal_class.parameters: (long bytes)
focal_class.return: String
focal_class.signature: String getReadableByteCount(long bytes)
focal_class.class_method_signature: RequestSizeGatewayFilterFactory.apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_class.full_signature: @Override public GatewayFilter apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_class.return: GatewayFilter
focal_class.signature: GatewayFilter apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_class.superclass: extends AbstractGatewayFilterFactory<RequestSizeGatewayFilterFactory.RequestSizeConfig>
focal_method.body: @Override
  	public GatewayFilter apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig) {
  		requestSizeConfig.validate();
  		return new GatewayFilter() {
  			@Override
  			public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
  				ServerHttpRequest request = exchange.getRequest();
  				String contentLength = request.getHeaders().getFirst("content-length");
  				if (!StringUtils.isEmpty(contentLength)) {
  					Long currentRequestSize = Long.valueOf(contentLength);
  					if (currentRequestSize > requestSizeConfig.getMaxSize().toBytes()) {
  						exchange.getResponse().setStatusCode(HttpStatus.PAYLOAD_TOO_LARGE);
  						if (!exchange.getResponse().isCommitted()) {
  							exchange.getResponse().getHeaders().add("errorMessage",
  									getErrorMessage(currentRequestSize, requestSizeConfig.getMaxSize().toBytes()));
  						}
  						return exchange.getResponse().setComplete();
  					}
  				}
  				return chain.filter(exchange);
  			}
  
  			@Override
  			public String toString() {
  				return filterToStringCreator(RequestSizeGatewayFilterFactory.this)
  						.append("max", requestSizeConfig.getMaxSize()).toString();
  			}
  		};
  	}
focal_method.class_method_signature: RequestSizeGatewayFilterFactory.apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_method.full_signature: @Override public GatewayFilter apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_method.identifier: apply
focal_method.invocations: validate getRequest getFirst getHeaders isEmpty valueOf toBytes getMaxSize setStatusCode getResponse isCommitted getResponse add getHeaders getResponse getErrorMessage toBytes getMaxSize setComplete getResponse filter toString append filterToStringCreator getMaxSize
focal_method.modifiers: @Override public
focal_method.parameters: (RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)
focal_method.return: GatewayFilter
focal_method.signature: GatewayFilter apply(RequestSizeGatewayFilterFactory.RequestSizeConfig requestSizeConfig)