CSRFController.java

1
package edu.ucsb.cs156.courses.controllers;
2
3
import io.swagger.v3.oas.annotations.Operation;
4
import io.swagger.v3.oas.annotations.tags.Tag;
5
import org.springframework.context.annotation.Profile;
6
import org.springframework.security.web.csrf.CsrfToken;
7
import org.springframework.web.bind.annotation.GetMapping;
8
import org.springframework.web.bind.annotation.RestController;
9
10
@Profile("development")
11
@Tag(name = "CSRF (enabled only in development; can be used with Postman to test APIs)")
12
@RestController
13
public class CSRFController {
14
  @Operation(summary = "Get a CSRF Token")
15
  @GetMapping("/csrf")
16
  public CsrfToken csrf(CsrfToken token) {
17 1 1. csrf : replaced return value with null for edu/ucsb/cs156/courses/controllers/CSRFController::csrf → KILLED
    return token;
18
  }
19
}

Mutations

17

1.1
Location : csrf
Killed by : edu.ucsb.cs156.courses.controllers.CSRFControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.CSRFControllerTests]/[method:csrf_returns_ok()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/CSRFController::csrf → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3