UCSBSectionsController.java

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

Mutations

29

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

38

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.17.0