Skip to content

Commit

Permalink
Polish static nested test classes (#2531)
Browse files Browse the repository at this point in the history
* 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 <velo@users.noreply.github.com>
  • Loading branch information
4 people authored Sep 2, 2024
1 parent c9499c4 commit f2e8a94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
9 changes: 3 additions & 6 deletions core/src/test/java/feign/EnumForNameTest.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;

Expand Down Expand Up @@ -54,8 +52,7 @@ public void initKnownEnumValues(Object name, ProtocolVersion expectedProtocolVer

}

@Nested
public static class UnknownEnumValues {
public static class UnknownEnumValuesTest {

public Object name;

Expand Down
9 changes: 1 addition & 8 deletions core/src/test/java/feign/LoggerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -98,8 +97,7 @@ void levelEmits(Level logLevel, List<String> expectedMessages) {
}
}

@Nested
public static class ReasonPhraseOptional extends LoggerTest {
public static class ReasonPhraseOptionalTest extends LoggerTest {

private Level logLevel;

Expand Down Expand Up @@ -128,7 +126,6 @@ void reasonPhraseOptional(Level logLevel, List<String> expectedMessages) {
}
}

@Nested
public static class HttpProtocolVersionTest extends LoggerTest {

private Level logLevel;
Expand Down Expand Up @@ -174,7 +171,6 @@ void httpProtocolVersion(Level logLevel,
}
}

@Nested
public static class ReadTimeoutEmitsTest extends LoggerTest {

private Level logLevel;
Expand Down Expand Up @@ -231,7 +227,6 @@ public Retryer clone() {
}
}

@Nested
public static class UnknownHostEmitsTest extends LoggerTest {

private Level logLevel;
Expand Down Expand Up @@ -283,7 +278,6 @@ public Retryer clone() {
}
}

@Nested
public static class FormatCharacterTest extends LoggerTest {

private Level logLevel;
Expand Down Expand Up @@ -335,7 +329,6 @@ public Retryer clone() {
}
}

@Nested
public static class RetryEmitsTest extends LoggerTest {

private Level logLevel;
Expand Down
7 changes: 1 addition & 6 deletions core/src/test/java/feign/MethodInfoTest.java
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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<String> log();
Expand All @@ -39,7 +37,6 @@ void completableFutureOfString() throws Exception {
}
}

@Nested
static class GenericAsyncClientTest {
public interface GenericAsyncClient<T> {
T log();
Expand All @@ -56,7 +53,6 @@ void genericCompletableFutureOfString() throws Exception {
}
}

@Nested
static class SyncClientTest {
public interface SyncClient {
String log();
Expand All @@ -70,7 +66,6 @@ void string() throws Exception {
}
}

@Nested
static class GenericSyncClientTest {
public interface GenericSyncClient<T> {
T log();
Expand Down
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<trimStackTrace>false</trimStackTrace>
<argLine>${jvm.options}</argLine>
<excludes>
<exclude></exclude>
</excludes>
</configuration>
</plugin>

Expand Down

0 comments on commit f2e8a94

Please sign in to comment.