From a975b9d5daf900e29db981b0a6f64e936303ccde Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 26 Sep 2022 14:27:32 +0200 Subject: [PATCH] Suppress "unused" warnings in tests --- .../org/springframework/beans/BeanUtilsBenchmark.java | 2 ++ .../codec/json/CustomizedJackson2JsonDecoderTests.java | 10 ++++++---- .../codec/json/CustomizedJackson2JsonEncoderTests.java | 10 ++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/spring-beans/src/jmh/java/org/springframework/beans/BeanUtilsBenchmark.java b/spring-beans/src/jmh/java/org/springframework/beans/BeanUtilsBenchmark.java index 8bcf1f16d4..bbcf125773 100644 --- a/spring-beans/src/jmh/java/org/springframework/beans/BeanUtilsBenchmark.java +++ b/spring-beans/src/jmh/java/org/springframework/beans/BeanUtilsBenchmark.java @@ -54,6 +54,7 @@ public class BeanUtilsBenchmark { static class TestClass1{ }; + @SuppressWarnings("unused") static class TestClass2 { private final int value1; private final String value2; @@ -63,4 +64,5 @@ public class BeanUtilsBenchmark { this.value2 = value2; } } + } diff --git a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonDecoderTests.java b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonDecoderTests.java index 98de2af708..ea7e4da981 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonDecoderTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/json/CustomizedJackson2JsonDecoderTests.java @@ -35,19 +35,20 @@ import org.springframework.core.testfixture.codec.AbstractDecoderTests; * * @author Jason Laber */ -public class CustomizedJackson2JsonDecoderTests extends AbstractDecoderTests { +class CustomizedJackson2JsonDecoderTests extends AbstractDecoderTests { - public CustomizedJackson2JsonDecoderTests() { + CustomizedJackson2JsonDecoderTests() { super(new Jackson2JsonDecoderWithCustomization()); } + @Override public void canDecode() throws Exception { // Not Testing, covered under Jackson2JsonDecoderTests } - @Override @Test + @Override public void decode() throws Exception { Flux input = Flux.concat(stringBuffer("{\"property\":\"Value1\"}")); @@ -56,8 +57,8 @@ public class CustomizedJackson2JsonDecoderTests extends AbstractDecoderTests input = stringBuffer("{\"property\":\"Value2\"}"); @@ -91,6 +92,7 @@ public class CustomizedJackson2JsonDecoderTests extends AbstractDecoderTests { +class CustomizedJackson2JsonEncoderTests extends AbstractEncoderTests { - public CustomizedJackson2JsonEncoderTests() { + CustomizedJackson2JsonEncoderTests() { super(new Jackson2JsonEncoderWithCustomization()); } @@ -47,8 +47,8 @@ public class CustomizedJackson2JsonEncoderTests extends AbstractEncoderTests input = Flux.just( new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL1), @@ -63,7 +63,7 @@ public class CustomizedJackson2JsonEncoderTests extends AbstractEncoderTests input = Flux.just( new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL1), new MyCustomizedEncoderBean(MyCustomEncoderEnum.VAL2) @@ -85,10 +85,12 @@ public class CustomizedJackson2JsonEncoderTests extends AbstractEncoderTests