Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
meletis committed Dec 8, 2023
1 parent c327f89 commit d260fa5
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 15 deletions.
8 changes: 8 additions & 0 deletions src/main/java/org/example/service/MyService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.example.service;

import org.springframework.stereotype.Service;

@Service
public class MyService {

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@AutoConfigureMockMvc
@Testcontainers
@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
public class MyApplicationTest {
public class BaseTest {

@ServiceConnection
private static final MySQLContainer<?> mySQLContainer;
Expand Down
16 changes: 16 additions & 0 deletions src/test/java/org/example/FirstTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.example;

import org.example.service.MyService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

public class FirstTest extends BaseTest {

@Autowired
MyService myService;

@Test
void foo() {

}
}
14 changes: 0 additions & 14 deletions src/test/java/org/example/MyServiceTest.java

This file was deleted.

16 changes: 16 additions & 0 deletions src/test/java/org/example/SecondTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package org.example;

import org.example.service.MyService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.mock.mockito.MockBean;

public class SecondTest extends BaseTest {

@MockBean
MyService myService;

@Test
void foo() {

}
}

0 comments on commit d260fa5

Please sign in to comment.