From d2d5d7f38a1f2f5501e75f93d583c92c6f8fb690 Mon Sep 17 00:00:00 2001 From: MK13 Date: Mon, 18 Feb 2019 21:10:13 +0100 Subject: [PATCH] Add a basic startup test of the app --- .../financer/FinancerApplicationBootTest.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/test/java/de/financer/FinancerApplicationBootTest.java diff --git a/src/test/java/de/financer/FinancerApplicationBootTest.java b/src/test/java/de/financer/FinancerApplicationBootTest.java new file mode 100644 index 0000000..21ec49f --- /dev/null +++ b/src/test/java/de/financer/FinancerApplicationBootTest.java @@ -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); + } +}