Add a basic startup test of the app
This commit is contained in:
31
src/test/java/de/financer/FinancerApplicationBootTest.java
Normal file
31
src/test/java/de/financer/FinancerApplicationBootTest.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package de.financer;
|
||||||
|
|
||||||
|
import org.junit.Assert;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.TestPropertySource;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
import org.springframework.test.web.servlet.MockMvc;
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = FinancerApplication.class)
|
||||||
|
@AutoConfigureMockMvc
|
||||||
|
@TestPropertySource(
|
||||||
|
locations = "classpath:application-integrationtest.properties")
|
||||||
|
public class FinancerApplicationBootTest {
|
||||||
|
@Autowired
|
||||||
|
private MockMvc mockMvc;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_appBoots() {
|
||||||
|
// Nothing to do in this test as we just want to startup the app
|
||||||
|
// to make sure that spring, flyway and hibernate all work
|
||||||
|
// as expected even after changes
|
||||||
|
// While this slightly increases build time it's an easy and safe
|
||||||
|
// way to ensure that the app can start
|
||||||
|
Assert.assertTrue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user