SystemInfoController.java

1
package edu.ucsb.cs156.gauchoride.controllers;
2
3
import io.swagger.v3.oas.annotations.tags.Tag;
4
import io.swagger.v3.oas.annotations.Operation;
5
6
import org.springframework.beans.factory.annotation.Autowired;
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
import edu.ucsb.cs156.gauchoride.models.SystemInfo;
13
import edu.ucsb.cs156.gauchoride.services.SystemInfoService;
14
15
/**
16
 * SystemInfoController returns information about the application; typically
17
 * the values of environment variables that may be needed by the frontend.
18
 */
19
20
@Tag(name = "System Information")
21
@RequestMapping("/api/systemInfo")
22
@RestController
23
public class SystemInfoController extends ApiController {
24
25
    @Autowired
26
    private SystemInfoService systemInfoService;
27
28
    @Operation(summary = "Get global information about the application")
29
    @PreAuthorize("hasRole('ROLE_ADMIN')")
30
    @GetMapping("")
31
    public SystemInfo getSystemInfo() {
32 1 1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/SystemInfoController::getSystemInfo → KILLED
        return systemInfoService.getSystemInfo();
33
    }
34
35
}

Mutations

32

1.1
Location : getSystemInfo
Killed by : edu.ucsb.cs156.gauchoride.controllers.SystemInfoControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.SystemInfoControllerTests]/[method:systemInfo__admin_logged_in()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/SystemInfoController::getSystemInfo → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3