UserInfoController.java

1
package edu.ucsb.cs156.happiercows.controllers;
2
3
import edu.ucsb.cs156.happiercows.entities.User;
4
import edu.ucsb.cs156.happiercows.models.CurrentUser;
5
import edu.ucsb.cs156.happiercows.services.CurrentUserService;
6
import io.swagger.v3.oas.annotations.tags.Tag;
7
import io.swagger.v3.oas.annotations.Operation;
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
@Tag(name="Current User Information")
15
@RequestMapping("/api/currentUser")
16
@RestController
17
public class UserInfoController extends ApiController {
18
 
19
  @Operation(summary = "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/happiercows/controllers/UserInfoController::getCurrentUser → KILLED
    return super.getCurrentUser();
24
  }
25
}
26

Mutations

23

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