UCSBSectionsController.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.springframework.beans.factory.annotation.Autowired;
8
9
import org.springframework.http.ResponseEntity;
10
import org.springframework.web.bind.annotation.GetMapping;
11
import org.springframework.web.bind.annotation.RequestMapping;
12
import org.springframework.web.bind.annotation.RequestParam;
13
import org.springframework.web.bind.annotation.RestController;
14
15
import edu.ucsb.cs156.courses.repositories.UserRepository;
16
import edu.ucsb.cs156.courses.services.UCSBCurriculumService;
17
18
@RestController
19
@RequestMapping("/api/sections")
20
public class UCSBSectionsController {
21
    private ObjectMapper mapper = new ObjectMapper();
22
23
    @Autowired
24
    UserRepository userRepository;
25
26
    @Autowired
27
    UCSBCurriculumService ucsbCurriculumService;
28
29
    @GetMapping(value = "/basicsearch", produces = "application/json")
30
    public ResponseEntity<String> basicsearch(@RequestParam String qtr, @RequestParam String dept,
31
            @RequestParam String level) throws JsonProcessingException {
32
33
        String body = ucsbCurriculumService.getSectionJSON(dept, qtr, level);
34
35
36 1 1. basicsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBSectionsController::basicsearch → KILLED
        return ResponseEntity.ok().body(body);
37
    }      
38
39
    @GetMapping(value = "/sectionsearch", produces = "application/json")
40
    public ResponseEntity<String> sectionsearch(@RequestParam String qtr, @RequestParam String enrollCode) {
41
            
42
        String body = ucsbCurriculumService.getSection(enrollCode, qtr);
43
44 1 1. sectionsearch : replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBSectionsController::sectionsearch → KILLED
        return ResponseEntity.ok().body(body);
45
    }
46
}

Mutations

36

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

44

1.1
Location : sectionsearch
Killed by : edu.ucsb.cs156.courses.controllers.UCSBSectionsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.UCSBSectionsControllerTests]/[method:test_section_search()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/UCSBSectionsController::sectionsearch → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3