Skip to content
Snippets Groups Projects
EnvironmentControllerITCase.java 993 B
Newer Older
  • Learn to ignore specific revisions
  • OZGCloud's avatar
    OZGCloud committed
    package de.itvsh.goofy;
    
    import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
    import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
    import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
    
    import org.junit.jupiter.api.Test;
    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.web.servlet.MockMvc;
    
    @SpringBootTest
    @AutoConfigureMockMvc
    class EnvironmentControllerITCase {
    
    	@Autowired
    	private MockMvc mockMvc;
    
    	@Test
    	void loadEnvironment() throws Exception {
    		mockMvc.perform(get("/api/environment")).andExpect(status().isOk());
    	}
    
    	@Test
    	void shouldHaveProductionFalse() throws Exception {
    		mockMvc.perform(get("/api/environment"))//
    				.andExpect(jsonPath("$.production").value(false));
    	}
    }