UserInfoController.java

1
package edu.ucsb.cs156.courses.controllers;
2
3
import edu.ucsb.cs156.courses.entities.User;
4
import edu.ucsb.cs156.courses.models.CurrentUser;
5
import edu.ucsb.cs156.courses.services.CurrentUserService;
6
import io.swagger.annotations.Api;
7
import io.swagger.annotations.ApiOperation;
8
9
import org.springframework.security.access.prepost.PreAuthorize;
10
import org.springframework.web.bind.annotation.GetMapping;
11
import org.springframework.web.bind.annotation.RequestMapping;
12
import org.springframework.web.bind.annotation.RestController;
13
14
@Api(description="Current User Information")
15
@RequestMapping("/api/currentUser")
16
@RestController
17
public class UserInfoController extends ApiController {
18
 
19
  @ApiOperation(value = "Get information about current user")
20
  @PreAuthorize("hasRole('ROLE_USER')")
21
  @GetMapping("")
22
  public CurrentUser getCurrentUser() {
23 1 1. getCurrentUser : replaced return value with null for edu/ucsb/cs156/courses/controllers/UserInfoController::getCurrentUser → KILLED
    return super.getCurrentUser();
24
  }
25
}

Mutations

23

1.1
Location : getCurrentUser
Killed by : edu.ucsb.cs156.courses.controllers.UserInfoControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.UserInfoControllerTests]/[method:currentUser__logged_in()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/UserInfoController::getCurrentUser → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3