Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SpringBootTest
- @AutoConfigureMockMvc
- public class MessageControllerTest {
- @Autowired
- private MockMvc mockMvc;
- private String postUrl = "http://localhost:8081/api/messages?text=text1";
- @Test
- public void testPostMessage() throws Exception{
- mockMvc.perform(post(postUrl))
- .andDo(print())
- .andExpect(status().isOk())
- .andExpect(content().string(containsString("{\"id\": 0}")));// fixme how to test this case?
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement