Skip to content
Snippets Groups Projects
Commit deba5edf authored by Dominika Zemanovičová's avatar Dominika Zemanovičová
Browse files

Add mail controller tests

parent 8cbcbe98
No related branches found
No related tags found
2 merge requests!15Mail module test,!12Mail module
package org.fuseri.modulemail.service;
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;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest
@AutoConfigureMockMvc
class MailControllerTest {
@Autowired
private MockMvc mockMvc;
@Test
void getEmail() throws Exception {
mockMvc.perform(get("/mail/{id}", 1))
.andExpect(status().isOk());
}
@Test
void deleteMail() throws Exception {
mockMvc.perform(delete("/mail/delete/{id}", 1))
.andExpect(status().isOk());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment