Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -43,7 +43,6 @@ public class AthleteResource {
|
||||
@ApiResponses(value = {
|
||||
@ApiResponse(responseCode = "200", description = "Renvoie l'athlète créé", content = @Content(mediaType = "application/json", schema = @Schema(implementation = AthleteDTO.class)))
|
||||
})
|
||||
|
||||
@PostMapping("/create")
|
||||
@PreAuthorize("hasRole('Admin')") // Only admin can create??
|
||||
public ResponseEntity<AthleteDTO> create(@RequestBody AthleteDTO dto) {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package hackathon.FrisbYEE;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.web.servlet.client.RestTestClient;
|
||||
|
||||
import hackathon.FrisbYEE.rest.AthleteResource;
|
||||
|
||||
|
||||
class FrisbYEEApplicationTests {
|
||||
|
||||
//Controller
|
||||
private AthleteResource athleteResource;
|
||||
private RestTestClient mockMvc;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
athleteResource = new AthleteResource();
|
||||
mockMvc = RestTestClient.bindToController(athleteResource).build();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testGetUsers() throws Exception {
|
||||
//mockMvc.perform(get("/api/users"))
|
||||
// .andExpect(status().isOk());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user