CSRFController.java

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

Mutations

18

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