Merge remote-tracking branch 'origin/4.2.x'

This commit is contained in:
Olga Maciaszek-Sharma
2025-03-13 13:25:27 +01:00
parent 6351b64091
commit b822670fdc
2 changed files with 12 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2024 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -369,7 +369,10 @@ public class SpringMvcContract extends Contract.BaseContract implements Resource
data.template().query(resolve(nameValueResolver.getName()), resolve(nameValueResolver.getValue()));
}
else {
throw new IllegalArgumentException("Negated params are not supported: " + param);
if (LOG.isDebugEnabled()) {
LOG.debug("Negated params are not supported by Feign and ignored during parameter processing: "
+ param);
}
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2024 the original author or authors.
* Copyright 2013-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,6 +68,7 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
import static feign.CollectionFormat.CSV;
import static feign.CollectionFormat.SSV;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.junit.jupiter.api.Assumptions.assumeTrue;
@@ -509,11 +510,11 @@ class SpringMvcContractTests {
}
@Test
void testProcessAnnotations_ParseParams_NotEqualParams() throws Exception {
assertThatIllegalArgumentException().isThrownBy(() -> {
Method method = TestTemplate_ParseParams.class.getDeclaredMethod("notEqualParams");
void testProcessAnnotations_ParseParams_NegatedParams() {
assertThatCode(() -> {
Method method = TestTemplate_ParseParams.class.getDeclaredMethod("negatedParams");
contract.parseAndValidateMetadata(method.getDeclaringClass(), method);
});
}).doesNotThrowAnyException();
}
@Test
@@ -831,7 +832,7 @@ class SpringMvcContractTests {
ResponseEntity<TestObject> mixParams();
@GetMapping(value = "test", params = { "p1!=1" })
ResponseEntity<TestObject> notEqualParams();
ResponseEntity<TestObject> negatedParams();
@GetMapping(value = "test", params = { "p1=1" })
ResponseEntity<TestObject> paramsAndRequestParam(@RequestParam("p2") String p2);