SectionCSVLine.java

1
package edu.ucsb.cs156.courses.models;
2
3
import edu.ucsb.cs156.courses.documents.ConvertedSection;
4
import lombok.AllArgsConstructor;
5
import lombok.Builder;
6
import lombok.Data;
7
import lombok.NoArgsConstructor;
8
9
@Builder
10
@Data
11
@AllArgsConstructor
12
@NoArgsConstructor
13
public class SectionCSVLine {
14
15
  private String quarter;
16
  private String courseId;
17
  private String section;
18
  private String instructor;
19
  private String enrolled;
20
  private String maxEnroll;
21
  private String status;
22
  private String ges;
23
  private String days;
24
  private String beginTime;
25
  private String location;
26
27
  public static String intToStringWithDefault(Integer i) {
28 2 1. intToStringWithDefault : replaced return value with "" for edu/ucsb/cs156/courses/models/SectionCSVLine::intToStringWithDefault → KILLED
2. intToStringWithDefault : negated conditional → KILLED
    return i == null ? "0" : i.toString();
29
  }
30
31
  public static SectionCSVLine toSectionCSVLine(ConvertedSection cs) {
32
33 1 1. toSectionCSVLine : replaced return value with null for edu/ucsb/cs156/courses/models/SectionCSVLine::toSectionCSVLine → KILLED
    return SectionCSVLine.builder()
34
        .quarter(cs.getCourseInfo().getQuarter())
35
        .courseId(cs.getCourseInfo().getCourseId())
36
        .section(cs.getSection().getSection())
37
        .enrolled(intToStringWithDefault(cs.getSection().getEnrolledTotal()))
38
        .maxEnroll(intToStringWithDefault(cs.getSection().getMaxEnroll()))
39
        .instructor(cs.getSection().instructorList())
40
        .status(cs.getSection().status())
41
        .ges(cs.getCourseInfo().ges())
42
        .days(cs.getDays())
43
        .beginTime(cs.getBeginTimes())
44
        .location(cs.getLocations())
45
        .build();
46
  }
47
}

Mutations

28

1.1
Location : intToStringWithDefault
Killed by : edu.ucsb.cs156.courses.models.SectionCSVLineTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.models.SectionCSVLineTests]/[method:test_intToStringWithDefault()]
replaced return value with "" for edu/ucsb/cs156/courses/models/SectionCSVLine::intToStringWithDefault → KILLED

2.2
Location : intToStringWithDefault
Killed by : edu.ucsb.cs156.courses.models.SectionCSVLineTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.models.SectionCSVLineTests]/[method:test_intToStringWithDefault()]
negated conditional → KILLED

33

1.1
Location : toSectionCSVLine
Killed by : edu.ucsb.cs156.courses.controllers.CoursesCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.CoursesCSVControllerTests]/[method:testCsvForQuarterAndSubjectArea_success_defaults()]
replaced return value with null for edu/ucsb/cs156/courses/models/SectionCSVLine::toSectionCSVLine → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0