From 1112a721cc526747aa5f2c2a5229a34315bb9eb4 Mon Sep 17 00:00:00 2001 From: Dmitrii Nazukin <15947012+Nazukin-Dmitry@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:48:24 +0300 Subject: [PATCH] Polish static nested test classes -Remove @Nested annotaion -Some renaming to follow test naming convention -Setup maven-surefire-plugin to execute tatic nested test classes --- core/src/test/java/feign/EnumForNameTest.java | 7 ++----- core/src/test/java/feign/LoggerTest.java | 9 +-------- core/src/test/java/feign/MethodInfoTest.java | 5 ----- pom.xml | 3 +++ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/core/src/test/java/feign/EnumForNameTest.java b/core/src/test/java/feign/EnumForNameTest.java index 8d4258526..b69af9ab3 100644 --- a/core/src/test/java/feign/EnumForNameTest.java +++ b/core/src/test/java/feign/EnumForNameTest.java @@ -16,15 +16,13 @@ import static feign.Util.enumForName; import static org.assertj.core.api.Assertions.assertThat; import java.util.Arrays; -import org.junit.jupiter.api.Nested; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import feign.Request.ProtocolVersion; public class EnumForNameTest { - @Nested - public static class KnownEnumValues { + public static class KnownEnumValuesTest { public Object name; public ProtocolVersion expectedProtocolVersion; @@ -54,8 +52,7 @@ public void initKnownEnumValues(Object name, ProtocolVersion expectedProtocolVer } - @Nested - public static class UnknownEnumValues { + public static class UnknownEnumValuesTest { public Object name; diff --git a/core/src/test/java/feign/LoggerTest.java b/core/src/test/java/feign/LoggerTest.java index 9def8d330..5092e2af1 100644 --- a/core/src/test/java/feign/LoggerTest.java +++ b/core/src/test/java/feign/LoggerTest.java @@ -45,7 +45,6 @@ String login(@Param("customer_name") String customer, @Param("password") String password); } - @Nested public static class LogLevelEmitsTest extends LoggerTest { private Level logLevel; @@ -98,8 +97,7 @@ void levelEmits(Level logLevel, List expectedMessages) { } } - @Nested - public static class ReasonPhraseOptional extends LoggerTest { + public static class ReasonPhraseOptionalTest extends LoggerTest { private Level logLevel; @@ -128,7 +126,6 @@ void reasonPhraseOptional(Level logLevel, List expectedMessages) { } } - @Nested public static class HttpProtocolVersionTest extends LoggerTest { private Level logLevel; @@ -174,7 +171,6 @@ void httpProtocolVersion(Level logLevel, } } - @Nested public static class ReadTimeoutEmitsTest extends LoggerTest { private Level logLevel; @@ -231,7 +227,6 @@ public Retryer clone() { } } - @Nested public static class UnknownHostEmitsTest extends LoggerTest { private Level logLevel; @@ -283,7 +278,6 @@ public Retryer clone() { } } - @Nested public static class FormatCharacterTest extends LoggerTest { private Level logLevel; @@ -335,7 +329,6 @@ public Retryer clone() { } } - @Nested public static class RetryEmitsTest extends LoggerTest { private Level logLevel; diff --git a/core/src/test/java/feign/MethodInfoTest.java b/core/src/test/java/feign/MethodInfoTest.java index 89bc3f39b..ebfad67e4 100644 --- a/core/src/test/java/feign/MethodInfoTest.java +++ b/core/src/test/java/feign/MethodInfoTest.java @@ -18,14 +18,12 @@ import java.lang.reflect.Type; import java.util.List; import java.util.concurrent.CompletableFuture; -import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; public class MethodInfoTest { - @Nested static class AsyncClientTest { public interface AsyncClient { CompletableFuture log(); @@ -39,7 +37,6 @@ void completableFutureOfString() throws Exception { } } - @Nested static class GenericAsyncClientTest { public interface GenericAsyncClient { T log(); @@ -56,7 +53,6 @@ void genericCompletableFutureOfString() throws Exception { } } - @Nested static class SyncClientTest { public interface SyncClient { String log(); @@ -70,7 +66,6 @@ void string() throws Exception { } } - @Nested static class GenericSyncClientTest { public interface GenericSyncClient { T log(); diff --git a/pom.xml b/pom.xml index 6d49ee0ff..d567cea07 100644 --- a/pom.xml +++ b/pom.xml @@ -479,6 +479,9 @@ true false ${jvm.options} + + +