feature/implement-external-login-api #30
@@ -9,8 +9,10 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("test")
|
||||
@@ -19,10 +21,23 @@ class ApplicationTests {
|
||||
@Autowired
|
||||
private DataSource dataSource;
|
||||
|
||||
@Autowired
|
||||
private ApplicationContext context;
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
@Test
|
||||
void connectionToTestDbWorks() throws SQLException {
|
||||
try (Connection connection = dataSource.getConnection()) {
|
||||
assertThat(connection.getMetaData().getURL()).contains("vaessl_test");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void main() {
|
||||
Application.main(new String[] {});
|
||||
assertNotNull(context, "The Spring context should not be null");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user