UCSBCurriculumController.java

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

Mutations

39

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