UCSBCurriculumController.java

1
package edu.ucsb.cs156.courses.controllers;
2
3
import com.fasterxml.jackson.core.JsonProcessingException;
4
import com.fasterxml.jackson.databind.ObjectMapper;
5
import edu.ucsb.cs156.courses.repositories.UserRepository;
6
import edu.ucsb.cs156.courses.services.UCSBCurriculumService;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.http.ResponseEntity;
9
import org.springframework.web.bind.annotation.GetMapping;
10
import org.springframework.web.bind.annotation.RequestMapping;
11
import org.springframework.web.bind.annotation.RequestParam;
12
import org.springframework.web.bind.annotation.RestController;
13
14
@RestController
15
@RequestMapping("/api/public")
16
public class UCSBCurriculumController {
17
  private ObjectMapper mapper = new ObjectMapper();
18
19
  @Autowired UserRepository userRepository;
20
21
  @Autowired UCSBCurriculumService ucsbCurriculumService;
22
23
  @GetMapping(value = "/basicsearch", produces = "application/json")
24
  public ResponseEntity<String> basicsearch(
25
      @RequestParam String qtr, @RequestParam String dept, @RequestParam String level)
26
      throws JsonProcessingException {
27
28
    String body = ucsbCurriculumService.getJSON(dept, qtr, level);
29
30 1 1. basicsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::basicsearch → KILLED
    return ResponseEntity.ok().body(body);
31
  }
32
}

Mutations

30

1.1
Location : basicsearch
Killed by : edu.ucsb.cs156.courses.controllers.UCSBCurriculumControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.UCSBCurriculumControllerTests]/[method:test_search()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBCurriculumController::basicsearch → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3