This repository has been archived on 2024-06-10. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Backend/src/test/java/cc/fascinated/PasteControllerTests.java

30 lines
1.0 KiB
Java
Raw Normal View History

2024-04-23 00:59:28 +01:00
package cc.fascinated;
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.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@SpringBootTest
@AutoConfigureMockMvc
class MojangControllerTests {
@Autowired
private MockMvc mockMvc;
@Test
public void ensureUploadSuccess() throws Exception {
ResultActions result = mockMvc.perform(post("/upload")
.accept(MediaType.APPLICATION_JSON)
.contentType(MediaType.APPLICATION_JSON)
.content("joe"))
.andExpect(status().isOk());
}
}