From 45d8aadb0a3f39cea6664a03236575fe7ab2b487 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 27 Sep 2023 10:19:51 +0200 Subject: [PATCH] Polishing --- .../ParamsRequestConditionTests.java | 34 +++++++++---------- .../ParamsRequestConditionTests.java | 34 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/ParamsRequestConditionTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/ParamsRequestConditionTests.java index fb1c35ab41f6..165864efe4c7 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/ParamsRequestConditionTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/condition/ParamsRequestConditionTests.java @@ -32,55 +32,55 @@ * @author Rossen Stoyanchev * @author Stephane Nicoll */ -public class ParamsRequestConditionTests { +class ParamsRequestConditionTests { @Test - public void paramEquals() { + void paramEquals() { assertThat(new ParamsRequestCondition("foo")).isEqualTo(new ParamsRequestCondition("foo")); - assertThat(new ParamsRequestCondition("foo").equals(new ParamsRequestCondition("bar"))).isFalse(); - assertThat(new ParamsRequestCondition("foo").equals(new ParamsRequestCondition("FOO"))).isFalse(); + assertThat(new ParamsRequestCondition("foo")).isNotEqualTo(new ParamsRequestCondition("bar")); + assertThat(new ParamsRequestCondition("foo")).isNotEqualTo(new ParamsRequestCondition("FOO")); assertThat(new ParamsRequestCondition("foo=bar")).isEqualTo(new ParamsRequestCondition("foo=bar")); - assertThat(new ParamsRequestCondition("foo=bar").equals(new ParamsRequestCondition("FOO=bar"))).isFalse(); + assertThat(new ParamsRequestCondition("foo=bar")).isNotEqualTo(new ParamsRequestCondition("FOO=bar")); } @Test - public void paramPresent() { + void paramPresent() { ParamsRequestCondition condition = new ParamsRequestCondition("foo"); assertThat(condition.getMatchingCondition(MockServerWebExchange.from(get("/path?foo=")))).isNotNull(); } @Test // SPR-15831 - public void paramPresentNullValue() { + void paramPresentNullValue() { ParamsRequestCondition condition = new ParamsRequestCondition("foo"); assertThat(condition.getMatchingCondition(MockServerWebExchange.from(get("/path?foo")))).isNotNull(); } @Test - public void paramPresentNoMatch() { + void paramPresentNoMatch() { ParamsRequestCondition condition = new ParamsRequestCondition("foo"); assertThat(condition.getMatchingCondition(MockServerWebExchange.from(get("/path?bar=")))).isNull(); } @Test - public void paramNotPresent() { + void paramNotPresent() { MockServerWebExchange exchange = MockServerWebExchange.from(get("/")); assertThat(new ParamsRequestCondition("!foo").getMatchingCondition(exchange)).isNotNull(); } @Test - public void paramValueMatch() { + void paramValueMatch() { ParamsRequestCondition condition = new ParamsRequestCondition("foo=bar"); assertThat(condition.getMatchingCondition(MockServerWebExchange.from(get("/path?foo=bar")))).isNotNull(); } @Test - public void paramValueNoMatch() { + void paramValueNoMatch() { ParamsRequestCondition condition = new ParamsRequestCondition("foo=bar"); assertThat(condition.getMatchingCondition(MockServerWebExchange.from(get("/path?foo=bazz")))).isNull(); } @Test - public void compareTo() { + void compareTo() { ServerWebExchange exchange = MockServerWebExchange.from(get("/")); ParamsRequestCondition condition1 = new ParamsRequestCondition("foo", "bar", "baz"); @@ -94,7 +94,7 @@ public void compareTo() { } @Test // SPR-16674 - public void compareToWithMoreSpecificMatchByValue() { + void compareToWithMoreSpecificMatchByValue() { ServerWebExchange exchange = MockServerWebExchange.from(get("/")); ParamsRequestCondition condition1 = new ParamsRequestCondition("response_type=code"); @@ -105,7 +105,7 @@ public void compareToWithMoreSpecificMatchByValue() { } @Test - public void compareToWithNegatedMatch() { + void compareToWithNegatedMatch() { ServerWebExchange exchange = MockServerWebExchange.from(get("/")); ParamsRequestCondition condition1 = new ParamsRequestCondition("response_type!=code"); @@ -115,7 +115,7 @@ public void compareToWithNegatedMatch() { } @Test - public void combineWitOtherEmpty() { + void combineWithOtherEmpty() { ParamsRequestCondition condition1 = new ParamsRequestCondition("foo=bar"); ParamsRequestCondition condition2 = new ParamsRequestCondition(); @@ -124,7 +124,7 @@ public void combineWitOtherEmpty() { } @Test - public void combineWitThisEmpty() { + void combineWithThisEmpty() { ParamsRequestCondition condition1 = new ParamsRequestCondition(); ParamsRequestCondition condition2 = new ParamsRequestCondition("foo=bar"); @@ -133,7 +133,7 @@ public void combineWitThisEmpty() { } @Test - public void combine() { + void combine() { ParamsRequestCondition condition1 = new ParamsRequestCondition("foo=bar"); ParamsRequestCondition condition2 = new ParamsRequestCondition("foo=baz"); diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/ParamsRequestConditionTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/ParamsRequestConditionTests.java index 86de02d0f3ab..8891b906e62b 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/ParamsRequestConditionTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/condition/ParamsRequestConditionTests.java @@ -31,19 +31,19 @@ * @author Arjen Poutsma * @author Stephane Nicoll */ -public class ParamsRequestConditionTests { +class ParamsRequestConditionTests { @Test - public void paramEquals() { + void paramEquals() { assertThat(new ParamsRequestCondition("foo")).isEqualTo(new ParamsRequestCondition("foo")); - assertThat(new ParamsRequestCondition("foo").equals(new ParamsRequestCondition("bar"))).isFalse(); - assertThat(new ParamsRequestCondition("foo").equals(new ParamsRequestCondition("FOO"))).isFalse(); + assertThat(new ParamsRequestCondition("foo")).isNotEqualTo(new ParamsRequestCondition("bar")); + assertThat(new ParamsRequestCondition("foo")).isNotEqualTo(new ParamsRequestCondition("FOO")); assertThat(new ParamsRequestCondition("foo=bar")).isEqualTo(new ParamsRequestCondition("foo=bar")); - assertThat(new ParamsRequestCondition("foo=bar").equals(new ParamsRequestCondition("FOO=bar"))).isFalse(); + assertThat(new ParamsRequestCondition("foo=bar")).isNotEqualTo(new ParamsRequestCondition("FOO=bar")); } @Test - public void paramPresent() { + void paramPresent() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("foo", ""); @@ -51,7 +51,7 @@ public void paramPresent() { } @Test // SPR-15831 - public void paramPresentNullValue() { + void paramPresentNullValue() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("foo", (String) null); @@ -59,7 +59,7 @@ public void paramPresentNullValue() { } @Test - public void paramPresentNoMatch() { + void paramPresentNoMatch() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader("bar", ""); @@ -67,7 +67,7 @@ public void paramPresentNoMatch() { } @Test - public void paramNotPresent() { + void paramNotPresent() { ParamsRequestCondition condition = new ParamsRequestCondition("!foo"); MockHttpServletRequest request = new MockHttpServletRequest(); @@ -75,7 +75,7 @@ public void paramNotPresent() { } @Test - public void paramValueMatch() { + void paramValueMatch() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("foo", "bar"); @@ -83,7 +83,7 @@ public void paramValueMatch() { } @Test - public void paramValueNoMatch() { + void paramValueNoMatch() { MockHttpServletRequest request = new MockHttpServletRequest(); request.addParameter("foo", "bazz"); @@ -91,7 +91,7 @@ public void paramValueNoMatch() { } @Test - public void compareTo() { + void compareTo() { MockHttpServletRequest request = new MockHttpServletRequest(); ParamsRequestCondition condition1 = new ParamsRequestCondition("foo", "bar", "baz"); @@ -105,7 +105,7 @@ public void compareTo() { } @Test // SPR-16674 - public void compareToWithMoreSpecificMatchByValue() { + void compareToWithMoreSpecificMatchByValue() { MockHttpServletRequest request = new MockHttpServletRequest(); ParamsRequestCondition condition1 = new ParamsRequestCondition("response_type=code"); @@ -116,7 +116,7 @@ public void compareToWithMoreSpecificMatchByValue() { } @Test - public void compareToWithNegatedMatch() { + void compareToWithNegatedMatch() { MockHttpServletRequest request = new MockHttpServletRequest(); ParamsRequestCondition condition1 = new ParamsRequestCondition("response_type!=code"); @@ -126,7 +126,7 @@ public void compareToWithNegatedMatch() { } @Test - public void combineWithOtherEmpty() { + void combineWithOtherEmpty() { ParamsRequestCondition condition1 = new ParamsRequestCondition("foo=bar"); ParamsRequestCondition condition2 = new ParamsRequestCondition(); @@ -135,7 +135,7 @@ public void combineWithOtherEmpty() { } @Test - public void combineWithThisEmpty() { + void combineWithThisEmpty() { ParamsRequestCondition condition1 = new ParamsRequestCondition(); ParamsRequestCondition condition2 = new ParamsRequestCondition("foo=bar"); @@ -144,7 +144,7 @@ public void combineWithThisEmpty() { } @Test - public void combine() { + void combine() { ParamsRequestCondition condition1 = new ParamsRequestCondition("foo=bar"); ParamsRequestCondition condition2 = new ParamsRequestCondition("foo=baz");