test_class.declarator: responseMesssage = "Request Header/s size is larger than "
  			+ "permissible limit. Request Header/s size is \\d*B where permissible limit is \\d*B"
test_class.modifier: private static final
test_class.original_string: private static final String responseMesssage = "Request Header/s size is larger than "
  			+ "permissible limit. Request Header/s size is \\d*B where permissible limit is \\d*B";
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/RequestHeaderSizeGatewayFilterFactoryTest.java
test_class.identifier: RequestHeaderSizeGatewayFilterFactoryTest
test_class.superclass: extends BaseWebClientTests
test_case.body: @Test
  	public void toStringFormat() {
  		Config config = new Config();
  		config.setMaxSize(DataSize.ofBytes(1000L));
  		GatewayFilter filter = new RequestHeaderSizeGatewayFilterFactory().apply(config);
  		assertThat(filter.toString()).contains("max").contains("1000B");
  	}
test_case.class_method_signature: RequestHeaderSizeGatewayFilterFactoryTest.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: ERROR = "Request Header/s size is larger than permissible limit."
  			+ " Request Header/s size is %s where permissible limit is %s"
focal_class.modifier: private static
focal_class.original_string: private static String ERROR = "Request Header/s size is larger than permissible limit."
  			+ " Request Header/s 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/RequestHeaderSizeGatewayFilterFactory.java
focal_class.identifier: RequestHeaderSizeGatewayFilterFactory
focal_class.class_method_signature: RequestHeaderSizeGatewayFilterFactory.RequestHeaderSizeGatewayFilterFactory()
focal_class.full_signature: public  RequestHeaderSizeGatewayFilterFactory()
focal_class.identifier: RequestHeaderSizeGatewayFilterFactory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  RequestHeaderSizeGatewayFilterFactory()
focal_class.class_method_signature: RequestHeaderSizeGatewayFilterFactory.apply(RequestHeaderSizeGatewayFilterFactory.Config config)
focal_class.full_signature: @Override public GatewayFilter apply(RequestHeaderSizeGatewayFilterFactory.Config config)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (RequestHeaderSizeGatewayFilterFactory.Config config)
focal_class.return: GatewayFilter
focal_class.signature: GatewayFilter apply(RequestHeaderSizeGatewayFilterFactory.Config config)
focal_class.class_method_signature: RequestHeaderSizeGatewayFilterFactory.getErrorMessage(Long currentRequestSize, DataSize maxSize)
focal_class.full_signature: private static String getErrorMessage(Long currentRequestSize, DataSize maxSize)
focal_class.identifier: getErrorMessage
focal_class.modifiers: private static
focal_class.parameters: (Long currentRequestSize, DataSize maxSize)
focal_class.return: String
focal_class.signature: String getErrorMessage(Long currentRequestSize, DataSize maxSize)
focal_class.superclass: extends AbstractGatewayFilterFactory<RequestHeaderSizeGatewayFilterFactory.Config>
focal_method.body: @Override
  	public GatewayFilter apply(RequestHeaderSizeGatewayFilterFactory.Config config) {
  		return new GatewayFilter() {
  			@Override
  			public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
  				ServerHttpRequest request = exchange.getRequest();
  				HttpHeaders headers = request.getHeaders();
  				Long headerSizeInBytes = 0L;
  
  				for (Map.Entry<String, List<String>> headerEntry : headers.entrySet()) {
  					List<String> values = headerEntry.getValue();
  					for (String value : values) {
  						headerSizeInBytes += Long.valueOf(value.getBytes().length);
  					}
  				}
  
  				if (headerSizeInBytes > config.getMaxSize().toBytes()) {
  					exchange.getResponse().setStatusCode(HttpStatus.REQUEST_HEADER_FIELDS_TOO_LARGE);
  					exchange.getResponse().getHeaders().add("errorMessage",
  							getErrorMessage(headerSizeInBytes, config.getMaxSize()));
  					return exchange.getResponse().setComplete();
  
  				}
  
  				return chain.filter(exchange);
  			}
  
  			@Override
  			public String toString() {
  				return filterToStringCreator(RequestHeaderSizeGatewayFilterFactory.this)
  						.append("max", config.getMaxSize()).toString();
  			}
  		};
  	}
focal_method.class_method_signature: RequestHeaderSizeGatewayFilterFactory.apply(RequestHeaderSizeGatewayFilterFactory.Config config)
focal_method.full_signature: @Override public GatewayFilter apply(RequestHeaderSizeGatewayFilterFactory.Config config)
focal_method.identifier: apply
focal_method.invocations: getRequest getHeaders entrySet getValue valueOf getBytes toBytes getMaxSize setStatusCode getResponse add getHeaders getResponse getErrorMessage getMaxSize setComplete getResponse filter toString append filterToStringCreator getMaxSize
focal_method.modifiers: @Override public
focal_method.parameters: (RequestHeaderSizeGatewayFilterFactory.Config config)
focal_method.return: GatewayFilter
focal_method.signature: GatewayFilter apply(RequestHeaderSizeGatewayFilterFactory.Config config)