UserInfoController.java

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

Mutations

21

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

Active mutators

Tests examined


Report generated by PIT 1.7.3