Skip to content

Instantly share code, notes, and snippets.

@netodevel
Created December 30, 2016 15:33
Show Gist options
  • Save netodevel/b06c69c25ce5d173ffe44f7177be96f2 to your computer and use it in GitHub Desktop.
Save netodevel/b06c69c25ce5d173ffe44f7177be96f2 to your computer and use it in GitHub Desktop.
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());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment