UCSBCurriculumService.java

1
package edu.ucsb.cs156.courses.services;
2
3
import com.fasterxml.jackson.core.type.TypeReference;
4
import com.fasterxml.jackson.databind.ObjectMapper;
5
import edu.ucsb.cs156.courses.documents.ConvertedSection;
6
import edu.ucsb.cs156.courses.documents.CoursePage;
7
import edu.ucsb.cs156.courses.documents.GERequirement;
8
import edu.ucsb.cs156.courses.documents.Primary;
9
import java.time.Duration;
10
import java.util.Arrays;
11
import java.util.HashMap;
12
import java.util.List;
13
import java.util.Map;
14
import java.util.stream.Collectors;
15
import lombok.extern.slf4j.Slf4j;
16
import org.springframework.beans.factory.annotation.Autowired;
17
import org.springframework.beans.factory.annotation.Value;
18
import org.springframework.boot.web.client.RestTemplateBuilder;
19
import org.springframework.http.HttpEntity;
20
import org.springframework.http.HttpHeaders;
21
import org.springframework.http.HttpMethod;
22
import org.springframework.http.HttpStatus;
23
import org.springframework.http.MediaType;
24
import org.springframework.http.ResponseEntity;
25
import org.springframework.stereotype.Service;
26
import org.springframework.web.client.RestTemplate;
27
28
/** Service object that wraps the UCSB Academic Curriculum API */
29
@Service
30
@Slf4j
31
public class UCSBCurriculumService {
32
33
  @Autowired private ObjectMapper objectMapper;
34
35
  @Value("${app.ucsb.api.consumer_key}")
36
  private String apiKey;
37
38
  @Value("${app.ucsb.api.host}")
39
  private String apiHost;
40
41
  private static final Duration CONNECT_TIMEOUT = Duration.ofSeconds(10);
42
  private static final Duration READ_TIMEOUT = Duration.ofSeconds(60);
43
44
  private RestTemplate restTemplate = new RestTemplate();
45
46
  public UCSBCurriculumService(RestTemplateBuilder restTemplateBuilder) throws Exception {
47
    restTemplate =
48
        restTemplateBuilder.connectTimeout(CONNECT_TIMEOUT).readTimeout(READ_TIMEOUT).build();
49
  }
50
51
  public static final String CURRICULUM_ENDPOINT =
52
      "{apiHost}/academics/curriculums/v1/classes/search";
53
54
  public static final String SUBJECTS_ENDPOINT = "{apiHost}/students/lookups/v1/subjects";
55
56
  public static final String SECTION_ENDPOINT =
57
      "{apiHost}/academics/curriculums/v1/classsection/{quarter}/{enrollcode}";
58
59
  public static final String ALL_SECTIONS_ENDPOINT =
60
      "{apiHost}/academics/curriculums/v3/classes/{quarter}/{enrollcode}";
61
62
  public static final String FINALS_ENDPOINT = "{apiHost}/academics/curriculums/v3/finals";
63
64
  public static final String GE_ENDPOINT = "{apiHost}/students/lookups/v1/requirements";
65
66
  public String getJSON(String subjectArea, String quarter, String courseLevel) throws Exception {
67
68
    HttpHeaders headers = new HttpHeaders();
69 1 1. getJSON : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
70 1 1. getJSON : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
71 1 1. getJSON : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "1.0");
72 1 1. getJSON : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
73
74
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
75
76
    String params =
77
        String.format(
78
            "?quarter=%s&subjectCode=%s&objLevelCode=%s&pageNumber=%d&pageSize=%d&includeClassSections=%s",
79
            quarter, subjectArea, courseLevel, 1, 100, "true");
80
    String url = CURRICULUM_ENDPOINT + params;
81
82 1 1. getJSON : negated conditional → KILLED
    if (courseLevel.equals("A")) {
83
      params =
84
          String.format(
85
              "?quarter=%s&subjectCode=%s&pageNumber=%d&pageSize=%d&includeClassSections=%s",
86
              quarter, subjectArea, 1, 100, "true");
87
      url = CURRICULUM_ENDPOINT + params;
88
    }
89
90
    url = url.replace("{apiHost}", apiHost);
91
92
    log.info("url=" + url);
93
94
    String retVal = "";
95
    MediaType contentType = null;
96
    HttpStatus statusCode = null;
97
98
    ResponseEntity<String> re = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
99
    contentType = re.getHeaders().getContentType();
100
    statusCode = (HttpStatus) re.getStatusCode();
101
    retVal = re.getBody();
102
103
    log.trace("json: {}", retVal);
104
    log.info("contentType: {} statusCode: {}", contentType, statusCode);
105 1 1. getJSON : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getJSON → KILLED
    return retVal;
106
  }
107
108
  public List<ConvertedSection> getConvertedSections(
109
      String subjectArea, String quarter, String courseLevel) throws Exception {
110
    String json = getJSON(subjectArea, quarter, courseLevel);
111
    CoursePage coursePage = objectMapper.readValue(json, CoursePage.class);
112
    List<ConvertedSection> result = coursePage.convertedSections();
113 1 1. getConvertedSections : replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getConvertedSections → KILLED
    return result;
114
  }
115
116
  /**
117
   * This method retrieves course information and reformats it so that each primary is a single
118
   * object, that has a list of all of it's secondaries.
119
   *
120
   * <p>As a reminder, the UCSB course registration systems (GOLD, Blue, Star, etc.) treat all
121
   * courses as "sections", even what we typically call "lectures". In the database, some courses
122
   * have both primary and secondary sections. Primary sections have section numbers ending in 00
123
   * (e.g. 100, 200, 300, up to 9900), while secondaries have numbers ending with 01, 02, 03, etc.
124
   * and "belong" with a primary.
125
   *
126
   * <p>What we typically refer to as "lectures" are primary sections ending in 00 (e.g. 100, 200,
127
   * 300). What we typically refer to as discussion sections are secondaries and end with 01, 02,
128
   * 03, etc.
129
   *
130
   * <p>
131
   *
132
   * <p>The UCSB API <i>almost</i> does this, but not quite. It returns a list of all sections, but
133
   * does not group them into primaries and secondaries. This method relies on the <code>
134
   * getPrimaries</code> method of the <code>Page</code> class to reformat the data so that each
135
   * primary section is a single object, with a list of all of its secondaries.
136
   *
137
   * @param subjectArea
138
   * @param quarter
139
   * @param courseLevel
140
   * @return a list of Primaries
141
   * @throws Exception
142
   */
143
  public List<Primary> getPrimaries(String subjectArea, String quarter, String courseLevel)
144
      throws Exception {
145 1 1. getPrimaries : replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getPrimaries → KILLED
    return getCoursePage(subjectArea, quarter, courseLevel).getPrimaries();
146
  }
147
148
  /**
149
   * Fetch and parse a page of course data once, so callers can use it both ways: as primaries for
150
   * the response (getPrimaries()) and as converted sections for upserting into MongoDB
151
   * (convertedSections()).
152
   */
153
  public CoursePage getCoursePage(String subjectArea, String quarter, String courseLevel)
154
      throws Exception {
155
    String json = getJSON(subjectArea, quarter, courseLevel);
156 1 1. getCoursePage : replaced return value with null for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getCoursePage → KILLED
    return objectMapper.readValue(json, CoursePage.class);
157
  }
158
159
  public String getJSONByGE(String quarter, String area) throws Exception {
160
    HttpHeaders headers = new HttpHeaders();
161 1 1. getJSONByGE : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
162 1 1. getJSONByGE : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
163 1 1. getJSONByGE : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "1.0");
164 1 1. getJSONByGE : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
165
166
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
167
168
    String params =
169
        String.format("?quarter=%s&areas=%s&pageNumber=%d&pageSize=%d", quarter, area, 1, 500);
170
    String url = (CURRICULUM_ENDPOINT + params).replace("{apiHost}", apiHost);
171
172
    log.info("url=" + url);
173
174
    String retVal = "";
175
    MediaType contentType = null;
176
    HttpStatus statusCode = null;
177
178
    ResponseEntity<String> re = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
179
    contentType = re.getHeaders().getContentType();
180
    statusCode = (HttpStatus) re.getStatusCode();
181
    retVal = re.getBody();
182
183
    log.trace("json: {}", retVal);
184
    log.info("contentType: {} statusCode: {}", contentType, statusCode);
185 1 1. getJSONByGE : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getJSONByGE → KILLED
    return retVal;
186
  }
187
188
  public List<Primary> getPrimariesByGE(String quarter, String area) throws Exception {
189 1 1. getPrimariesByGE : replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getPrimariesByGE → KILLED
    return getCoursePageByGE(quarter, area).getPrimaries();
190
  }
191
192
  /** GE counterpart of {@link #getCoursePage}. */
193
  public CoursePage getCoursePageByGE(String quarter, String area) throws Exception {
194
    String json = getJSONByGE(quarter, area);
195 1 1. getCoursePageByGE : replaced return value with null for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getCoursePageByGE → KILLED
    return objectMapper.readValue(json, CoursePage.class);
196
  }
197
198
  public String getSectionJSON(String subjectArea, String quarter, String courseLevel)
199
      throws Exception {
200
    List<ConvertedSection> l = getConvertedSections(subjectArea, quarter, courseLevel);
201
202
    String arrayToJson = objectMapper.writeValueAsString(l);
203
204 1 1. getSectionJSON : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getSectionJSON → KILLED
    return arrayToJson;
205
  }
206
207
  public String getSubjectsJSON() throws Exception {
208
209
    HttpHeaders headers = new HttpHeaders();
210 1 1. getSubjectsJSON : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
211 1 1. getSubjectsJSON : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
212 1 1. getSubjectsJSON : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "1.0");
213 1 1. getSubjectsJSON : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
214
215
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
216
217
    String url = SUBJECTS_ENDPOINT.replace("{apiHost}", apiHost);
218
219
    log.info("url=" + url);
220
221
    String retVal = "";
222
    MediaType contentType = null;
223
    HttpStatus statusCode = null;
224
225
    ResponseEntity<String> re = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
226
    contentType = re.getHeaders().getContentType();
227
    statusCode = (HttpStatus) re.getStatusCode();
228
    retVal = re.getBody();
229
230
    log.info("json: {} contentType: {} statusCode: {}", retVal, contentType, statusCode);
231 1 1. getSubjectsJSON : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getSubjectsJSON → KILLED
    return retVal;
232
  }
233
234
  /**
235
   * This method retrieves exactly one section matching the enrollCode and quarter arguments, if
236
   * such a section exists.
237
   */
238
  public String getSection(String enrollCode, String quarter) throws Exception {
239
240
    HttpHeaders headers = new HttpHeaders();
241 1 1. getSection : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
242 1 1. getSection : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
243 1 1. getSection : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "1.0");
244 1 1. getSection : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
245
246
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
247
248
    String url = SECTION_ENDPOINT.replace("{apiHost}", apiHost);
249
250
    log.info("url=" + url);
251
252
    Map<String, String> params = new HashMap<>();
253
    params.put("quarter", quarter);
254
    params.put("enrollcode", enrollCode);
255
256
    String retVal = "";
257
    MediaType contentType = null;
258
    HttpStatus statusCode = null;
259
260
    ResponseEntity<String> re =
261
        restTemplate.exchange(url, HttpMethod.GET, entity, String.class, params);
262
    contentType = re.getHeaders().getContentType();
263
    statusCode = (HttpStatus) re.getStatusCode();
264
    retVal = re.getBody();
265
266 1 1. getSection : negated conditional → KILLED
    if (retVal.equals("null")) {
267
      retVal = "{\"error\": \"Enroll code doesn't exist in that quarter.\"}";
268
    }
269
270
    log.info("json: {} contentType: {} statusCode: {}", retVal, contentType, statusCode);
271 1 1. getSection : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getSection → KILLED
    return retVal;
272
  }
273
274
  /**
275
   * This method retrieves all of the sections related to a certain enroll code. For example, if the
276
   * enrollCode is for a discussion section, the lecture section and all related discussion sections
277
   * will also be returned.
278
   */
279
  public String getAllSections(String enrollCode, String quarter) throws Exception {
280
281
    HttpHeaders headers = new HttpHeaders();
282 1 1. getAllSections : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
283 1 1. getAllSections : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
284 1 1. getAllSections : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "3.0");
285 1 1. getAllSections : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
286
287
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
288
289
    String url = ALL_SECTIONS_ENDPOINT.replace("{apiHost}", apiHost);
290
291
    log.info("url=" + url);
292
293
    Map<String, String> params = new HashMap<>();
294
    params.put("quarter", quarter);
295
    params.put("enrollcode", enrollCode);
296
297
    String retVal = "";
298
    MediaType contentType = null;
299
    HttpStatus statusCode = null;
300
301
    ResponseEntity<String> re =
302
        restTemplate.exchange(url, HttpMethod.GET, entity, String.class, params);
303
    contentType = re.getHeaders().getContentType();
304
    statusCode = (HttpStatus) re.getStatusCode();
305
    retVal = re.getBody();
306
307 1 1. getAllSections : negated conditional → KILLED
    if (retVal.equals("null")) {
308
      retVal = "{\"error\": \"Enroll code doesn't exist in that quarter.\"}";
309
    }
310
311
    log.info("json: {} contentType: {} statusCode: {}", retVal, contentType, statusCode);
312 1 1. getAllSections : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getAllSections → KILLED
    return retVal;
313
  }
314
315
  public String getJSONbyQtrEnrollCd(String quarter, String enrollCd) throws Exception {
316
317
    HttpHeaders headers = new HttpHeaders();
318 1 1. getJSONbyQtrEnrollCd : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
319 1 1. getJSONbyQtrEnrollCd : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
320 1 1. getJSONbyQtrEnrollCd : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "1.0");
321 1 1. getJSONbyQtrEnrollCd : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
322
323
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
324
325
    String url = "{apiHost}/academics/curriculums/v3/classsection/" + quarter + "/" + enrollCd;
326
    url = url.replace("{apiHost}", apiHost);
327
328
    log.info("url=" + url);
329
330
    String retVal = "";
331
    MediaType contentType = null;
332
    HttpStatus statusCode = null;
333
334
    ResponseEntity<String> re = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
335
    contentType = re.getHeaders().getContentType();
336
    statusCode = (HttpStatus) re.getStatusCode();
337
    retVal = re.getBody();
338
339
    log.info("json: {} contentType: {} statusCode: {}", retVal, contentType, statusCode);
340 1 1. getJSONbyQtrEnrollCd : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getJSONbyQtrEnrollCd → KILLED
    return retVal;
341
  }
342
343
  public String getFinalsInfo(String quarter, String enrollCd) throws Exception {
344
    HttpHeaders headers = new HttpHeaders();
345 1 1. getFinalsInfo : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
346 1 1. getFinalsInfo : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "3.0");
347 1 1. getFinalsInfo : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
348
349
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
350
351
    String params = String.format("?quarter=%s&enrollCode=%s", quarter, enrollCd);
352
    String url = (FINALS_ENDPOINT + params).replace("{apiHost}", apiHost);
353
354
    log.info("url=" + url);
355
356
    String retVal;
357
    MediaType contentType;
358
    HttpStatus statusCode;
359
360
    ResponseEntity<String> re = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
361
    contentType = re.getHeaders().getContentType();
362
    statusCode = (HttpStatus) re.getStatusCode();
363
    retVal = re.getBody();
364
365
    log.info("json: {} contentType: {} statusCode: {}", retVal, contentType, statusCode);
366 1 1. getFinalsInfo : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getFinalsInfo → KILLED
    return retVal;
367
  }
368
369
  public String getGeneralEducationInfo() throws Exception {
370
    HttpHeaders headers = new HttpHeaders();
371 1 1. getGeneralEducationInfo : removed call to org/springframework/http/HttpHeaders::setAccept → KILLED
    headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
372 1 1. getGeneralEducationInfo : removed call to org/springframework/http/HttpHeaders::setContentType → KILLED
    headers.setContentType(MediaType.APPLICATION_JSON);
373 1 1. getGeneralEducationInfo : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-version", "1.0");
374 1 1. getGeneralEducationInfo : removed call to org/springframework/http/HttpHeaders::set → KILLED
    headers.set("ucsb-api-key", this.apiKey);
375
376
    HttpEntity<String> entity = new HttpEntity<>("body", headers);
377
378
    String url = GE_ENDPOINT.replace("{apiHost}", apiHost);
379
380
    log.info("Fetching GE areas from {}", url);
381
    ResponseEntity<String> response =
382
        restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
383
384
    log.debug("GE areas JSON: {}", response.getBody());
385 1 1. getGeneralEducationInfo : replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getGeneralEducationInfo → KILLED
    return response.getBody();
386
  }
387
388
  public List<String> getRequirementCodesByCollege(String collegeCode) throws Exception {
389
    String json = getGeneralEducationInfo();
390
391
    List<GERequirement> allAreas =
392
        objectMapper.readValue(json, new TypeReference<List<GERequirement>>() {});
393
394 1 1. getRequirementCodesByCollege : replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getRequirementCodesByCollege → KILLED
    return allAreas.stream()
395 2 1. lambda$getRequirementCodesByCollege$0 : replaced boolean return with false for edu/ucsb/cs156/courses/services/UCSBCurriculumService::lambda$getRequirementCodesByCollege$0 → KILLED
2. lambda$getRequirementCodesByCollege$0 : replaced boolean return with true for edu/ucsb/cs156/courses/services/UCSBCurriculumService::lambda$getRequirementCodesByCollege$0 → KILLED
        .filter(area -> area.getCollegeCode().equalsIgnoreCase(collegeCode))
396
        .map(GERequirement::getRequirementCode)
397
        .distinct()
398
        .collect(Collectors.toList());
399
  }
400
}

Mutations

69

1.1
Location : getJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSON_success()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

70

1.1
Location : getJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSON_success()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

71

1.1
Location : getJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSON_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

72

1.1
Location : getJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSON_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

82

1.1
Location : getJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSON_success()]
negated conditional → KILLED

105

1.1
Location : getJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSON_success()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getJSON → KILLED

113

1.1
Location : getConvertedSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getConvertedSections()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getConvertedSections → KILLED

145

1.1
Location : getPrimaries
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getPrimaries()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getPrimaries → KILLED

156

1.1
Location : getCoursePage
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getPrimaries()]
replaced return value with null for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getCoursePage → KILLED

161

1.1
Location : getJSONByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONByGE()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

162

1.1
Location : getJSONByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONByGE()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

163

1.1
Location : getJSONByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONByGE()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

164

1.1
Location : getJSONByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONByGE()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

185

1.1
Location : getJSONByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONByGE()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getJSONByGE → KILLED

189

1.1
Location : getPrimariesByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getPrimariesGE()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getPrimariesByGE → KILLED

195

1.1
Location : getCoursePageByGE
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getPrimariesGE()]
replaced return value with null for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getCoursePageByGE → KILLED

204

1.1
Location : getSectionJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionJSON()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getSectionJSON → KILLED

210

1.1
Location : getSubjectsJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSubjectsJSON_success()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

211

1.1
Location : getSubjectsJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSubjectsJSON_success()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

212

1.1
Location : getSubjectsJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSubjectsJSON_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

213

1.1
Location : getSubjectsJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSubjectsJSON_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

231

1.1
Location : getSubjectsJSON
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSubjectsJSON_success()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getSubjectsJSON → KILLED

241

1.1
Location : getSection
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionsuccess()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

242

1.1
Location : getSection
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionsuccess()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

243

1.1
Location : getSection
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionsuccess()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

244

1.1
Location : getSection
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionsuccess()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

266

1.1
Location : getSection
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionsuccess()]
negated conditional → KILLED

271

1.1
Location : getSection
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getSectionsuccess()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getSection → KILLED

282

1.1
Location : getAllSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getAllSections_success()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

283

1.1
Location : getAllSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getAllSections_success()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

284

1.1
Location : getAllSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getAllSections_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

285

1.1
Location : getAllSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getAllSections_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

307

1.1
Location : getAllSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getAllSections_success()]
negated conditional → KILLED

312

1.1
Location : getAllSections
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getAllSections_success()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getAllSections → KILLED

318

1.1
Location : getJSONbyQtrEnrollCd
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONbyQtrEnrollCd_success()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

319

1.1
Location : getJSONbyQtrEnrollCd
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONbyQtrEnrollCd_success()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

320

1.1
Location : getJSONbyQtrEnrollCd
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONbyQtrEnrollCd_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

321

1.1
Location : getJSONbyQtrEnrollCd
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONbyQtrEnrollCd_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

340

1.1
Location : getJSONbyQtrEnrollCd
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getJSONbyQtrEnrollCd_success()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getJSONbyQtrEnrollCd → KILLED

345

1.1
Location : getFinalsInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getFinalsInfo_success()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

346

1.1
Location : getFinalsInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getFinalsInfo_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

347

1.1
Location : getFinalsInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getFinalsInfo_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

366

1.1
Location : getFinalsInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getFinalsInfo_success()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getFinalsInfo → KILLED

371

1.1
Location : getGeneralEducationInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getGeneralEducationInfo_success()]
removed call to org/springframework/http/HttpHeaders::setAccept → KILLED

372

1.1
Location : getGeneralEducationInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getGeneralEducationInfo_success()]
removed call to org/springframework/http/HttpHeaders::setContentType → KILLED

373

1.1
Location : getGeneralEducationInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getGeneralEducationInfo_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

374

1.1
Location : getGeneralEducationInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getGeneralEducationInfo_success()]
removed call to org/springframework/http/HttpHeaders::set → KILLED

385

1.1
Location : getGeneralEducationInfo
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getGeneralEducationInfo_success()]
replaced return value with "" for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getGeneralEducationInfo → KILLED

394

1.1
Location : getRequirementCodesByCollege
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getRequirementCodesByCollege_filtersAndDistinct()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/services/UCSBCurriculumService::getRequirementCodesByCollege → KILLED

395

1.1
Location : lambda$getRequirementCodesByCollege$0
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getRequirementCodesByCollege_filtersAndDistinct()]
replaced boolean return with false for edu/ucsb/cs156/courses/services/UCSBCurriculumService::lambda$getRequirementCodesByCollege$0 → KILLED

2.2
Location : lambda$getRequirementCodesByCollege$0
Killed by : edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.services.UCSBCurriculumServiceTests]/[method:test_getRequirementCodesByCollege_filtersAndDistinct()]
replaced boolean return with true for edu/ucsb/cs156/courses/services/UCSBCurriculumService::lambda$getRequirementCodesByCollege$0 → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1