From f2e8a946dda972f8662ff6e04ad9c988ce765ea8 Mon Sep 17 00:00:00 2001 From: Dmitrii Date: Mon, 2 Sep 2024 17:20:39 +0300 Subject: [PATCH] Polish static nested test classes (#2531) * 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 * Update pom.xml Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Dmitrii Nazukin <15947012+Nazukin-Dmitry@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Marvin --- core/src/test/java/feign/EnumForNameTest.java | 9 +++------ core/src/test/java/feign/LoggerTest.java | 9 +-------- core/src/test/java/feign/MethodInfoTest.java | 7 +------ pom.xml | 3 +++ 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/core/src/test/java/feign/EnumForNameTest.java b/core/src/test/java/feign/EnumForNameTest.java index 8d4258526..ada53660b 100644 --- a/core/src/test/java/feign/EnumForNameTest.java +++ b/core/src/test/java/feign/EnumForNameTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 The Feign Authors + * Copyright 2012-2024 The Feign Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -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..7b5cade7b 100644 --- a/core/src/test/java/feign/MethodInfoTest.java +++ b/core/src/test/java/feign/MethodInfoTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 The Feign Authors + * Copyright 2012-2024 The Feign Authors * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at @@ -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 29d1b5b0c..bfd8c818b 100644 --- a/pom.xml +++ b/pom.xml @@ -479,6 +479,9 @@ true false ${jvm.options} + + +