SystemInfoController.java

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

Mutations

40

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

46

1.1
Location : getSchools
Killed by : edu.ucsb.cs156.frontiers.controllers.SystemInfoControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.SystemInfoControllerTests]/[method:school_list_matches()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/SystemInfoController::getSchools → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0