Error fix

This commit is contained in:
BuildTools 2020-11-05 14:32:42 +01:00
parent e0df090a0e
commit 228969efce
5 changed files with 6 additions and 6 deletions

View File

@ -49,9 +49,9 @@ public class CommisionController extends TokenBasedController {
} }
@PostMapping("/user") @PostMapping("/user")
@ApiOperation("Create commision with assignents to given groups. If group doesn't exist error will be thrown") @ApiOperation(value = "Create commision with assignents to given groups. If group doesn't exist error will be thrown")
public ResponseEntity<String> addCommision( public ResponseEntity<String> addCommision(
@RequestBody @ApiParam(value = "List of groups ids user want to assign to. If group doesnt exisit error will be thrown", example = "[12,7,3]") List<Long> groups) @RequestBody @ApiParam(value = "List of groups ids user want to assign to. If group doesnt exisit error will be thrown") List<Long> groups)
throws UserNotFoundException { throws UserNotFoundException {
User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException()); User user = this.getCurrentUser().orElseThrow(() -> new NullPointerException());

View File

@ -36,7 +36,7 @@ public class GroupController {
@GetMapping("/course/{id}") @GetMapping("/course/{id}")
@ApiOperation(value = "Return list of lectures and classes (if present) given course") @ApiOperation(value = "Return list of lectures and classes (if present) given course")
public ResponseEntity<GetCourseGroupsResponse<? extends DefaultGroupResponse>> getCourses( public ResponseEntity<GetCourseGroupsResponse<? extends DefaultGroupResponse>> getCourses(
@PathVariable(name = "id") @ApiParam(value = "Id of course") Long id, @PathVariable(name = "id") Long id,
@RequestParam(name = "capacity", defaultValue = "true") @ApiParam(value = "Boolean if we want to have capacity field in response") Boolean capacity) { @RequestParam(name = "capacity", defaultValue = "true") @ApiParam(value = "Boolean if we want to have capacity field in response") Boolean capacity) {
List<Groups> groups = this.groupService.getGroupsByCourse(id); List<Groups> groups = this.groupService.getGroupsByCourse(id);
if (capacity) { if (capacity) {

View File

@ -30,7 +30,7 @@ public class TokenController {
@GetMapping("/token") @GetMapping("/token")
@ApiOperation(value = "Endpoint to access token required to call secured endpoints. In order to access token we need to provide access token comming from unviersity CAS system") @ApiOperation(value = "Endpoint to access token required to call secured endpoints. In order to access token we need to provide access token comming from unviersity CAS system")
public ResponseEntity<String> getToken( public ResponseEntity<String> getToken(
@RequestParam("ticket") @ApiParam(value = "Ticket get from CAS system", example = "ST-1376572-wo41gty5R0JCZFKMMie2-cas.amu.edu.pl") final String ticket) { @RequestParam("ticket") @ApiParam(value = "Ticket get from CAS system. It should look like ST-1376572-wo41gty5R0JCZFKMMie2-cas.amu.edu.pl") final String ticket) {
final CasValidator validator = new CasValidator(SERVICE_URL, ticket); final CasValidator validator = new CasValidator(SERVICE_URL, ticket);
try { try {

View File

@ -33,7 +33,7 @@ public class UsersController {
@Autowired @Autowired
private UserService userService; private UserService userService;
@GetMapping("/search") @GetMapping("/student/search")
@PreAuthorize("hasRole('ROLE_DEANERY')") @PreAuthorize("hasRole('ROLE_DEANERY')")
@ApiOperation(value = "Serch for user by providing query. If query is empty it will return all students. You need token with DEANERY role to call this") @ApiOperation(value = "Serch for user by providing query. If query is empty it will return all students. You need token with DEANERY role to call this")
public ResponseEntity<List<SearchForStudentsResponse>> configApp( public ResponseEntity<List<SearchForStudentsResponse>> configApp(

View File

@ -22,7 +22,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SpringBootTest @SpringBootTest
@ContextConfiguration @ContextConfiguration
public class UsersControllerTest { public class UsersControllerTest {
private static final String ENDPOINT = "/api/v1/users/search"; private static final String ENDPOINT = "/api/v1/users/student/search";
@Autowired @Autowired
private WebApplicationContext webApplicationContext; private WebApplicationContext webApplicationContext;