Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. @RunWith(SpringRunner.class)
  2. @ActiveProfiles("test")
  3. @SpringBootTest(classes = {ConfigurableEnvironment.class, SecurityContextUtils.class})
  4. @WebAppConfiguration
  5. public class ConfigurationControllerImplTest {
  6.  
  7. private MockMvc mockMvc;
  8.  
  9. @Autowired
  10. private ConfigurableEnvironment environment;
  11.  
  12. @Autowired
  13. private SecurityContextUtils securityContextUtils;
  14.  
  15. @Before
  16. public void setup() throws Exception {
  17. mockMvc = MockMvcBuilders.standaloneSetup(new ConfigurationControllerImpl(environment, securityContextUtils)).build();
  18. }
  19.  
  20. @Test
  21. public void getConfigField() throws Exception {
  22. mockMvc.perform(MockMvcRequestBuilders.post("/v1/conf/app/prop1")).andExpect(status().isOk());
  23. }
  24. }
  25.  
  26. ---
  27. wo:
  28. ui.config.wo:
  29. path: "file:/conf.json"
  30.  
  31. spring:
  32. profiles: test
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement