package io.github.fanky10.labs.sjbe.web;

import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.IntegrationTest;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

import io.github.fanky10.labs.sjbe.Application;
import io.github.fanky10.labs.sjbe.web.rest.AppController;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Application.class)
@WebAppConfiguration
@IntegrationTest
public class AppControllerIncTest {
	
	private MockMvc restUserMockMvc;

    @Before
    public void setup() {
    	AppController appController = new AppController();
        this.restUserMockMvc = MockMvcBuilders.standaloneSetup(appController).build();
    }

    @Test
    public void testGetApplication() throws Exception {
        restUserMockMvc.perform(get("/api/application")
                .accept(MediaType.APPLICATION_JSON))
                .andExpect(status().isOk())
                .andExpect(content().contentType("application/json"))
                .andExpect(jsonPath("$.version").value("1.0.1"));
    }

}

@@ -386,24 +386,53 @@
 rs.status;%0A%0A
+import javax.inject.Inject;%0A%0A
 import org.j
@@ -795,32 +795,90 @@
 pConfiguration;%0A
+import org.springframework.test.util.ReflectionTestUtils;%0A
 import org.sprin
@@ -1026,24 +1026,77 @@
 pplication;%0A
+import io.github.fanky10.labs.sjbe.config.AppConfig;%0A
 import io.gi
@@ -1318,17 +1318,56 @@
 cTest %7B%0A
-%09
+%0A%09@Inject%0A%09private AppConfig appConfig;%0A
 %0A%09privat
@@ -1398,20 +1398,17 @@
 c;%0A%0A
-    
+%09
 @Before%0A
     
@@ -1403,20 +1403,17 @@
 @Before%0A
-    
+%09
 public v
@@ -1426,20 +1426,17 @@
 tup() %7B%0A
-    
+%09
 %09AppCont
@@ -1479,24 +1479,100 @@
 ller();%0A
-        
+%09%09ReflectionTestUtils.setField(appController, %22appConfiguration%22,%0A%09%09%09%09appConfig);%0A%09%09
 this.res
@@ -1632,16 +1632,21 @@
 troller)
+%0A%09%09%09%09
 .build()
@@ -1651,29 +1651,20 @@
 ();%0A
-    %7D%0A%0A    
+%09%7D%0A%0A%09
 @Test%0A
-    
+%09
 publ
@@ -1711,24 +1711,18 @@
 ption %7B%0A
-        
+%09%09
 restUser
@@ -1728,16 +1728,21 @@
 rMockMvc
+%0A%09%09%09%09
 .perform
@@ -1742,16 +1742,23 @@
 perform(
+%0A%09%09%09%09%09%09
 get(%22/ap
@@ -1776,33 +1776,25 @@
 on%22)
-%0A                .accept(
+.accept(%0A%09%09%09%09%09%09%09%09
 Medi
@@ -1818,32 +1818,20 @@
 _JSON))%0A
-                
+%09%09%09%09
 .andExpe
@@ -1850,32 +1850,20 @@
 isOk())%0A
-                
+%09%09%09%09
 .andExpe
@@ -1912,24 +1912,12 @@
 %22))%0A
-                
+%09%09%09%09
 .and
@@ -1966,12 +1966,9 @@
 ));%0A
-    
+%09
 %7D%0A%0A%7D

Fix project build