SystemInfoController.java

1
package edu.ucsb.cs156.example.controllers;
2
3
import edu.ucsb.cs156.example.models.SystemInfo;
4
import edu.ucsb.cs156.example.services.SystemInfoService;
5
import io.swagger.v3.oas.annotations.Operation;
6
import io.swagger.v3.oas.annotations.tags.Tag;
7
8
import org.springframework.beans.factory.annotation.Autowired;
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
/**
15
 * This is a REST controller for getting information about the system.
16
 *
17
 * It allows frontend access to some of the global values set in the
18
 * backend of the application, some of which are set by environment
19
 * variables.
20
 * 
21
 * For more information see the SystemInfoService and SystemInfo classes.
22
 * 
23
 * @see edu.ucsb.cs156.example.services.SystemInfoService
24
 * @see edu.ucsb.cs156.example.models.SystemInfo
25
 */
26
27
@Tag(name = "System Information")
28
@RequestMapping("/api/systemInfo")
29
@RestController
30
public class SystemInfoController extends ApiController {
31
32
    @Autowired
33
    private SystemInfoService systemInfoService;
34
35
    /**
36
     * This method returns the system information.
37
     * @return the system information
38
     */
39
40
    @Operation(summary = "Get global information about the application")
41
    @GetMapping("")
42
    public SystemInfo getSystemInfo() {
43 1 1. getSystemInfo : replaced return value with null for edu/ucsb/cs156/example/controllers/SystemInfoController::getSystemInfo → KILLED
        return systemInfoService.getSystemInfo();
44
    }
45
46
}

Mutations

43

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

Active mutators

Tests examined


Report generated by PIT 1.17.0