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

Mutations

33

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

42

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