Skip to content

Commit 79a78d0

Browse files
committed
Revert "Merge remote-tracking branch 'origin/4.2.x'"
This reverts commit b822670.
1 parent b822670 commit 79a78d0

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SpringMvcContract.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2025 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -369,10 +369,7 @@ private void parseParams(MethodMetadata data, Method method, RequestMapping meth
369369
data.template().query(resolve(nameValueResolver.getName()), resolve(nameValueResolver.getValue()));
370370
}
371371
else {
372-
if (LOG.isDebugEnabled()) {
373-
LOG.debug("Negated params are not supported by Feign and ignored during parameter processing: "
374-
+ param);
375-
}
372+
throw new IllegalArgumentException("Negated params are not supported: " + param);
376373
}
377374
}
378375
}

spring-cloud-openfeign-core/src/test/java/org/springframework/cloud/openfeign/support/SpringMvcContractTests.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2025 the original author or authors.
2+
* Copyright 2013-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,7 +68,6 @@
6868
import static feign.CollectionFormat.CSV;
6969
import static feign.CollectionFormat.SSV;
7070
import static org.assertj.core.api.Assertions.assertThat;
71-
import static org.assertj.core.api.Assertions.assertThatCode;
7271
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
7372
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
7473
import static org.junit.jupiter.api.Assumptions.assumeTrue;
@@ -510,11 +509,11 @@ void testProcessAnnotations_ParseParams_MultipleParamsWithoutValue() throws Exce
510509
}
511510

512511
@Test
513-
void testProcessAnnotations_ParseParams_NegatedParams() {
514-
assertThatCode(() -> {
515-
Method method = TestTemplate_ParseParams.class.getDeclaredMethod("negatedParams");
512+
void testProcessAnnotations_ParseParams_NotEqualParams() throws Exception {
513+
assertThatIllegalArgumentException().isThrownBy(() -> {
514+
Method method = TestTemplate_ParseParams.class.getDeclaredMethod("notEqualParams");
516515
contract.parseAndValidateMetadata(method.getDeclaringClass(), method);
517-
}).doesNotThrowAnyException();
516+
});
518517
}
519518

520519
@Test
@@ -832,7 +831,7 @@ public interface TestTemplate_ParseParams {
832831
ResponseEntity<TestObject> mixParams();
833832

834833
@GetMapping(value = "test", params = { "p1!=1" })
835-
ResponseEntity<TestObject> negatedParams();
834+
ResponseEntity<TestObject> notEqualParams();
836835

837836
@GetMapping(value = "test", params = { "p1=1" })
838837
ResponseEntity<TestObject> paramsAndRequestParam(@RequestParam("p2") String p2);

0 commit comments

Comments
 (0)