Created
December 30, 2016 18:55
-
-
Save netodevel/40f4c39c0be8edd4b6b5b8c86c9c1bc2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.test.web.servlet.MockMvc; | |
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; | |
import org.springframework.test.web.servlet.result.MockMvcResultMatchers; | |
import org.springframework.test.web.servlet.setup.MockMvcBuilders; | |
public class SalarioMinimoControllerTest extends DemoApplicationTests { | |
private MockMvc mockMvc; | |
@Autowired | |
private SalarioMinimoController salarioMinimoController; | |
@Before | |
public void setUp() { | |
this.mockMvc = MockMvcBuilders.standaloneSetup(salarioMinimoController).build(); | |
} | |
@Test | |
public void testGETIndexSalarioMinimoController() throws Exception { | |
this.mockMvc.perform(MockMvcRequestBuilders.get("/salarios")).andExpect(MockMvcResultMatchers.status().isOk()); | |
} | |
@Test | |
public void testGETSaveSalarioMinimoController() throws Exception { | |
this.mockMvc.perform(MockMvcRequestBuilders.get("/salarios/novo")) | |
.andExpect(MockMvcResultMatchers.model().attributeExists("salarioMinimo")) | |
.andExpect(MockMvcResultMatchers.status().isOk()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment