UserInfoController.java

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

Mutations

24

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

Active mutators

Tests examined


Report generated by PIT 1.7.3