Merge remote-tracking branch 'origin/main'

This commit is contained in:
tuanvu
2026-01-07 10:16:41 +01:00
6 changed files with 133 additions and 30 deletions

View File

@@ -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) {

View File

@@ -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());
}
}