Skip to content

Commit fc79174

Browse files
committed
GH-1326 - Remove @nested from EnableScenarioIntegrationTests.
1 parent dee0d88 commit fc79174

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

spring-modulith-integration-test/src/test/java/com/acme/myproject/moduleA/ApplicationModuleTestIntegrationTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@
2222
import org.springframework.beans.factory.annotation.Autowired;
2323
import org.springframework.boot.test.autoconfigure.web.reactive.AutoConfigureWebTestClient;
2424
import org.springframework.context.ApplicationContext;
25-
import org.springframework.modulith.test.ApplicationModuleTest;
2625
import org.springframework.test.context.ContextConfiguration;
2726
import org.springframework.test.web.reactive.server.WebTestClient;
2827

28+
import com.acme.myproject.NonVerifyingModuleTest;
29+
2930
/**
3031
* Integration tests for {@link ApplicationModuleTest}.
3132
*
3233
* @author Oliver Drotbohm
3334
*/
34-
@ApplicationModuleTest(verifyAutomatically = false)
35+
@NonVerifyingModuleTest
3536
class ApplicationModuleTestIntegrationTests {
3637

3738
@Test // GH-173
@@ -46,7 +47,7 @@ void bootstrapsSecondLevelMestMethod() {}
4647

4748
// GH-253
4849
@Nested
49-
@ApplicationModuleTest(verifyAutomatically = false)
50+
@NonVerifyingModuleTest
5051
@ContextConfiguration
5152
@AutoConfigureWebTestClient
5253
class SampleTest {

spring-modulith-integration-test/src/test/java/com/acme/myproject/moduleB/ModuleBTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import org.mockito.Mockito;
2323
import org.springframework.beans.factory.annotation.Autowired;
2424
import org.springframework.boot.autoconfigure.AutoConfigurationPackages;
25-
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2625
import org.springframework.context.ApplicationContext;
2726
import org.springframework.modulith.test.ApplicationModuleTest.BootstrapMode;
2827
import org.springframework.modulith.test.TestUtils;
28+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2929

3030
import com.acme.myproject.NonVerifyingModuleTest;
3131
import com.acme.myproject.moduleA.ServiceComponentA;
@@ -37,7 +37,7 @@
3737
class ModuleBTest {
3838

3939
@Nested
40-
static class WithoutMocksTest {
40+
class WithoutMocksTest {
4141

4242
@Autowired ServiceComponentB serviceComponentB;
4343

@@ -52,7 +52,7 @@ void failsToStartBecauseServiceComponentAIsMissing() throws Exception {
5252

5353
@Nested
5454
@NonVerifyingModuleTest
55-
static class WithMocksTest {
55+
class WithMocksTest {
5656

5757
@Autowired ApplicationContext context;
5858
@MockitoBean ServiceComponentA serviceComponentA;
@@ -80,7 +80,7 @@ void tweaksAutoConfigurationPackageToModulePackage() {
8080

8181
@Nested
8282
@NonVerifyingModuleTest(BootstrapMode.DIRECT_DEPENDENCIES)
83-
static class WithUpstreamModuleTest {
83+
class WithUpstreamModuleTest {
8484

8585
@Autowired ServiceComponentA componentA;
8686
@Autowired ServiceComponentB componentB;

spring-modulith-integration-test/src/test/java/com/acme/myproject/moduleC/ModuleCTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
import org.junit.jupiter.api.Nested;
2121
import org.junit.jupiter.api.Test;
2222
import org.springframework.beans.factory.annotation.Autowired;
23-
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2423
import org.springframework.modulith.test.ApplicationModuleTest.BootstrapMode;
2524
import org.springframework.modulith.test.TestUtils;
25+
import org.springframework.test.context.bean.override.mockito.MockitoBean;
2626

2727
import com.acme.myproject.NonVerifyingModuleTest;
2828
import com.acme.myproject.moduleA.ServiceComponentA;
@@ -34,7 +34,7 @@
3434
class ModuleCTest {
3535

3636
@Nested
37-
public static class FailsStandaloneTest {
37+
class FailsStandaloneTest {
3838

3939
@NonVerifyingModuleTest
4040
static class Config {}
@@ -46,7 +46,7 @@ void failsStandalone() {
4646
}
4747

4848
@Nested
49-
static class FailsWithDirectDependencyTest {
49+
class FailsWithDirectDependencyTest {
5050

5151
@NonVerifyingModuleTest(BootstrapMode.DIRECT_DEPENDENCIES)
5252
static class Config {}
@@ -59,7 +59,7 @@ void failsWithDirectDependency() {
5959

6060
@Nested
6161
@NonVerifyingModuleTest(BootstrapMode.DIRECT_DEPENDENCIES)
62-
static class SucceedsWithDirectDependencyPlusItsDependenciesMocksTest {
62+
class SucceedsWithDirectDependencyPlusItsDependenciesMocksTest {
6363

6464
@MockitoBean ServiceComponentA serviceComponentA;
6565

@@ -71,7 +71,7 @@ void bootstrapsContext() {
7171

7272
@Nested
7373
@NonVerifyingModuleTest(BootstrapMode.ALL_DEPENDENCIES)
74-
static class SucceedsWithAllDependenciesTest {
74+
class SucceedsWithAllDependenciesTest {
7575

7676
@Autowired ServiceComponentA serviceComponentA;
7777
@Autowired ServiceComponentB serviceComponentB;

spring-modulith-test/src/test/java/org/springframework/modulith/test/EnableScenarioIntegrationTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import example.TestConfiguration;
2222

23-
import org.junit.jupiter.api.Nested;
2423
import org.junit.jupiter.api.Test;
2524
import org.springframework.boot.test.context.SpringBootTest;
2625
import org.springframework.context.annotation.Bean;
@@ -34,7 +33,6 @@
3433
*
3534
* @author Oliver Drotbohm
3635
*/
37-
@Nested
3836
@EnableScenarios
3937
@SpringBootTest(classes = { TestConfiguration.class, TransactionTemplateTestConfiguration.class })
4038
class EnableScenarioIntegrationTests {

0 commit comments

Comments
 (0)