RosterStudentsCSVController.java

1
package edu.ucsb.cs156.frontiers.controllers;
2
3
import com.fasterxml.jackson.core.JsonProcessingException;
4
import com.opencsv.CSVReader;
5
import com.opencsv.exceptions.CsvException;
6
import edu.ucsb.cs156.frontiers.entities.Course;
7
import edu.ucsb.cs156.frontiers.entities.RosterStudent;
8
import edu.ucsb.cs156.frontiers.enums.InsertStatus;
9
import edu.ucsb.cs156.frontiers.enums.RosterStatus;
10
import edu.ucsb.cs156.frontiers.errors.EntityNotFoundException;
11
import edu.ucsb.cs156.frontiers.jobs.RemoveStudentsJob;
12
import edu.ucsb.cs156.frontiers.models.LoadResult;
13
import edu.ucsb.cs156.frontiers.models.UpsertResponse;
14
import edu.ucsb.cs156.frontiers.repositories.CourseRepository;
15
import edu.ucsb.cs156.frontiers.repositories.RosterStudentRepository;
16
import edu.ucsb.cs156.frontiers.services.OrganizationMemberService;
17
import edu.ucsb.cs156.frontiers.services.StudentDropService;
18
import edu.ucsb.cs156.frontiers.services.UpdateUserService;
19
import edu.ucsb.cs156.jobs.services.JobService;
20
import io.swagger.v3.oas.annotations.Operation;
21
import io.swagger.v3.oas.annotations.Parameter;
22
import io.swagger.v3.oas.annotations.tags.Tag;
23
import java.io.BufferedInputStream;
24
import java.io.IOException;
25
import java.io.InputStream;
26
import java.io.InputStreamReader;
27
import java.util.ArrayList;
28
import java.util.Arrays;
29
import java.util.HashMap;
30
import java.util.List;
31
import java.util.Map;
32
import lombok.extern.slf4j.Slf4j;
33
import org.springframework.beans.factory.annotation.Autowired;
34
import org.springframework.http.HttpStatus;
35
import org.springframework.http.ResponseEntity;
36
import org.springframework.security.access.prepost.PreAuthorize;
37
import org.springframework.web.bind.annotation.PostMapping;
38
import org.springframework.web.bind.annotation.RequestMapping;
39
import org.springframework.web.bind.annotation.RequestParam;
40
import org.springframework.web.bind.annotation.RestController;
41
import org.springframework.web.multipart.MultipartFile;
42
import org.springframework.web.server.ResponseStatusException;
43
44
@Tag(name = "RosterStudents")
45
@RequestMapping("/api/rosterstudents")
46
@RestController
47
@Slf4j
48
public class RosterStudentsCSVController extends ApiController {
49
50
  @Autowired private RosterStudentRepository rosterStudentRepository;
51
52
  @Autowired private CourseRepository courseRepository;
53
54
  @Autowired private UpdateUserService updateUserService;
55
56
  @Autowired private StudentDropService studentDropService;
57
  @Autowired private OrganizationMemberService organizationMemberService;
58
  @Autowired private JobService jobService;
59
60
  public enum RosterSourceType {
61
    UCSB_EGRADES,
62
    CHICO_CANVAS,
63
    OREGON_STATE,
64
    ROSTER_DOWNLOAD,
65
    UNKNOWN
66
  }
67
68
  public static final String UCSB_EGRADES_HEADERS =
69
      "Enrl Cd,Perm #,Grade,Final Units,Student Last,Student First Middle,Quarter,Course ID,Section,Meeting Time(s) / Location(s),Email,ClassLevel,Major1,Major2,Date/Time,Pronoun";
70
  public static final String CHICO_CANVAS_HEADERS =
71
      "Student Name,Student ID,Student SIS ID,Email,Section Name";
72
  public static final String OREGON_STATE_HEADERS =
73
      "Full name,Sortable name,Canvas user id,Overall course grade,Assignment on time percent,Last page view time,Last participation time,Last logged out,Email,SIS Id";
74
  public static final String ROSTER_DOWNLOAD_HEADERS =
75
      "COURSEID,EMAIL,FIRSTNAME,GITHUBID,GITHUBLOGIN,ID,LASTNAME,ORGSTATUS,ROSTERSTATUS,SECTION,STUDENTID,TEAMS,USERID";
76
77
  public static RosterSourceType getRosterSourceType(String[] headers) {
78
79
    Map<RosterSourceType, String[]> sourceTypeToHeaders = new HashMap<>();
80
81
    sourceTypeToHeaders.put(RosterSourceType.UCSB_EGRADES, UCSB_EGRADES_HEADERS.split(","));
82
    sourceTypeToHeaders.put(RosterSourceType.CHICO_CANVAS, CHICO_CANVAS_HEADERS.split(","));
83
    sourceTypeToHeaders.put(RosterSourceType.OREGON_STATE, OREGON_STATE_HEADERS.split(","));
84
    sourceTypeToHeaders.put(RosterSourceType.ROSTER_DOWNLOAD, ROSTER_DOWNLOAD_HEADERS.split(","));
85
86
    for (Map.Entry<RosterSourceType, String[]> entry : sourceTypeToHeaders.entrySet()) {
87
      RosterSourceType type = entry.getKey();
88
      String[] expectedHeaders = entry.getValue();
89 2 1. getRosterSourceType : changed conditional boundary → KILLED
2. getRosterSourceType : negated conditional → KILLED
      if (headers.length >= expectedHeaders.length) {
90
        boolean matches = true;
91 2 1. getRosterSourceType : negated conditional → KILLED
2. getRosterSourceType : changed conditional boundary → KILLED
        for (int i = 0; i < expectedHeaders.length; i++) {
92 1 1. getRosterSourceType : negated conditional → KILLED
          if (!expectedHeaders[i].trim().equalsIgnoreCase(headers[i].trim())) {
93
            matches = false;
94
            break;
95
          }
96
        }
97 1 1. getRosterSourceType : negated conditional → KILLED
        if (matches) {
98 1 1. getRosterSourceType : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED
          return type;
99
        }
100
      }
101
    }
102
    // If no known type matches, return UNKNOWN
103 1 1. getRosterSourceType : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED
    return RosterSourceType.UNKNOWN;
104
  }
105
106
  /**
107
   * Upload Roster students for Course in any supported format. It is important to keep the code in
108
   * this method consistent with the code for adding a single roster student
109
   *
110
   * @param courseId
111
   * @param file
112
   * @return
113
   * @throws JsonProcessingException
114
   * @throws IOException
115
   * @throws CsvException
116
   */
117
  @Operation(summary = "Upload Roster students for Course in any supported Format")
118
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
119
  @PostMapping(
120
      value = "/upload/csv",
121
      consumes = {"multipart/form-data"})
122
  public ResponseEntity<LoadResult> uploadRosterStudentsCSV(
123
      @Parameter(name = "courseId") @RequestParam Long courseId,
124
      @Parameter(name = "file") @RequestParam("file") MultipartFile file)
125
      throws JsonProcessingException, IOException, CsvException {
126
127
    Course course =
128
        courseRepository
129
            .findById(courseId)
130 1 1. lambda$uploadRosterStudentsCSV$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::lambda$uploadRosterStudentsCSV$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId.toString()));
131
132
    course.getRosterStudents().stream()
133 2 1. lambda$uploadRosterStudentsCSV$1 : negated conditional → KILLED
2. lambda$uploadRosterStudentsCSV$1 : replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::lambda$uploadRosterStudentsCSV$1 → KILLED
        .filter(filteredStudent -> filteredStudent.getRosterStatus() == RosterStatus.ROSTER)
134 2 1. lambda$uploadRosterStudentsCSV$2 : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
2. uploadRosterStudentsCSV : removed call to java/util/stream/Stream::forEach → KILLED
        .forEach(student -> student.setRosterStatus(RosterStatus.DROPPED));
135
136
    int counts[] = {0, 0};
137
    List<RosterStudent> rejectedStudents = new ArrayList<>();
138
139
    try (InputStream inputStream = new BufferedInputStream(file.getInputStream());
140
        InputStreamReader reader = new InputStreamReader(inputStream);
141
        CSVReader csvReader = new CSVReader(reader); ) {
142
143
      String[] headers = csvReader.readNext();
144
      RosterSourceType sourceType = getRosterSourceType(headers);
145 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
      if (sourceType == RosterSourceType.UNKNOWN) {
146
        throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown Roster Source Type");
147
      }
148 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
      if (sourceType == RosterSourceType.UCSB_EGRADES) {
149 1 1. uploadRosterStudentsCSV : removed call to com/opencsv/CSVReader::skip → KILLED
        csvReader.skip(1);
150
      }
151
      List<String[]> myEntries = csvReader.readAll();
152
      for (String[] row : myEntries) {
153
        RosterStudent rosterStudent = fromCSVRow(row, sourceType);
154
        UpsertResponse upsertResponse =
155
            RosterStudentsController.upsertStudent(rosterStudent, course, RosterStatus.ROSTER);
156 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
        if (upsertResponse.getInsertStatus() == InsertStatus.REJECTED) {
157
          rejectedStudents.add(upsertResponse.rosterStudent());
158
        } else {
159
          InsertStatus s = upsertResponse.getInsertStatus();
160 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
          if (s == InsertStatus.INSERTED) {
161
            course.getRosterStudents().add(upsertResponse.rosterStudent());
162
          }
163 1 1. uploadRosterStudentsCSV : Replaced integer addition with subtraction → KILLED
          counts[s.ordinal()]++;
164
        }
165
      }
166
    }
167 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
    if (rejectedStudents.isEmpty()) {
168
      List<RosterStudent> droppedStudents =
169
          course.getRosterStudents().stream()
170 2 1. lambda$uploadRosterStudentsCSV$3 : replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::lambda$uploadRosterStudentsCSV$3 → KILLED
2. lambda$uploadRosterStudentsCSV$3 : negated conditional → KILLED
              .filter(student -> student.getRosterStatus() == RosterStatus.DROPPED)
171
              .toList();
172
      LoadResult successfulResult =
173
          new LoadResult(
174
              counts[InsertStatus.INSERTED.ordinal()],
175
              counts[InsertStatus.UPDATED.ordinal()],
176
              droppedStudents.size(),
177
              List.of());
178 1 1. uploadRosterStudentsCSV : removed call to java/util/List::forEach → KILLED
      droppedStudents.forEach(studentDropService::dropStudent);
179
      rosterStudentRepository.saveAll(course.getRosterStudents());
180 1 1. uploadRosterStudentsCSV : removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUsersToRosterStudents → KILLED
      updateUserService.attachUsersToRosterStudents(course.getRosterStudents());
181
      RemoveStudentsJob job =
182
          RemoveStudentsJob.builder()
183
              .students(droppedStudents)
184
              .organizationMemberService(organizationMemberService)
185
              .rosterStudentRepository(rosterStudentRepository)
186
              .build();
187
      jobService.runAsJob(job);
188 1 1. uploadRosterStudentsCSV : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::uploadRosterStudentsCSV → KILLED
      return ResponseEntity.ok(successfulResult);
189
    } else {
190
      LoadResult conflictResult = new LoadResult(0, 0, 0, rejectedStudents);
191 1 1. uploadRosterStudentsCSV : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::uploadRosterStudentsCSV → KILLED
      return ResponseEntity.status(HttpStatus.CONFLICT).body(conflictResult);
192
    }
193
  }
194
195
  public static RosterStudent fromCSVRow(String[] row, RosterSourceType sourceType) {
196 1 1. fromCSVRow : negated conditional → KILLED
    if (sourceType == RosterSourceType.UCSB_EGRADES) {
197 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromUCSBEgradesCSVRow(row);
198 1 1. fromCSVRow : negated conditional → KILLED
    } else if (sourceType == RosterSourceType.CHICO_CANVAS) {
199 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromChicoCanvasCSVRow(row);
200 1 1. fromCSVRow : negated conditional → KILLED
    } else if (sourceType == RosterSourceType.OREGON_STATE) {
201 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromOregonStateCSVRow(row);
202 1 1. fromCSVRow : negated conditional → KILLED
    } else if (sourceType == RosterSourceType.ROSTER_DOWNLOAD) {
203 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromRosterDownloadCSVRow(row);
204
    } else {
205
      throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "CSV format not recognized");
206
    }
207
  }
208
209
  public static void checkRowLength(String[] row, int expectedLength, RosterSourceType sourceType) {
210 2 1. checkRowLength : changed conditional boundary → KILLED
2. checkRowLength : negated conditional → KILLED
    if (row.length < expectedLength) {
211
      throw new ResponseStatusException(
212
          HttpStatus.BAD_REQUEST,
213
          String.format(
214
              "%s CSV row does not have enough columns. Length = %d Row content = [%s]",
215
              sourceType.toString(), row.length, Arrays.toString(row)));
216
    }
217
  }
218
219
  public static RosterStudent fromUCSBEgradesCSVRow(String[] row) {
220 1 1. fromUCSBEgradesCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 11, RosterSourceType.UCSB_EGRADES);
221 1 1. fromUCSBEgradesCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromUCSBEgradesCSVRow → KILLED
    return RosterStudent.builder()
222
        .firstName(row[5])
223
        .lastName(row[4])
224
        .studentId(row[1])
225
        .email(row[10].strip())
226
        .section(row[0])
227
        .build();
228
  }
229
230
  public static RosterStudent fromChicoCanvasCSVRow(String[] row) {
231 1 1. fromChicoCanvasCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 4, RosterSourceType.CHICO_CANVAS);
232 1 1. fromChicoCanvasCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromChicoCanvasCSVRow → KILLED
    return RosterStudent.builder()
233
        .firstName(getFirstName(row[0]))
234
        .lastName(getLastName(row[0]))
235
        .studentId(row[2])
236
        .email(row[3].strip())
237
        .section("")
238
        .build();
239
  }
240
241
  public static RosterStudent fromOregonStateCSVRow(String[] row) {
242
243 1 1. fromOregonStateCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 10, RosterSourceType.OREGON_STATE);
244
    String sortableName = row[1];
245
    String sortableNameParts[] = sortableName.split(",");
246
    String lastName = sortableNameParts[0].trim();
247 2 1. fromOregonStateCSVRow : changed conditional boundary → KILLED
2. fromOregonStateCSVRow : negated conditional → KILLED
    String firstName = sortableNameParts.length > 1 ? sortableNameParts[1].trim() : "";
248 1 1. fromOregonStateCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromOregonStateCSVRow → KILLED
    return RosterStudent.builder()
249
        .firstName(firstName)
250
        .lastName(lastName)
251
        .studentId(row[9])
252
        .email(row[8].strip())
253
        .section("")
254
        .build();
255
  }
256
257
  public static RosterStudent fromRosterDownloadCSVRow(String[] row) {
258
    // Header order: COURSEID, EMAIL, FIRSTNAME, GITHUBID, GITHUBLOGIN, ID, LASTNAME,
259
    // ORGSTATUS, ROSTERSTATUS, SECTION, STUDENTID, TEAMS, USERID
260 1 1. fromRosterDownloadCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 13, RosterSourceType.ROSTER_DOWNLOAD);
261 1 1. fromRosterDownloadCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromRosterDownloadCSVRow → KILLED
    return RosterStudent.builder()
262
        .firstName(row[2])
263
        .lastName(row[6])
264
        .studentId(row[10])
265
        .email(row[1].strip())
266
        .section(row[9])
267
        .build();
268
  }
269
270
  /**
271
   * Get everything except up to and not including the last space in the full name. If the string
272
   * contains no spaces, return an empty string.
273
   *
274
   * @param fullName
275
   * @return
276
   */
277
  public static String getFirstName(String fullName) {
278
    int lastSpaceIndex = fullName.lastIndexOf(" ");
279 1 1. getFirstName : negated conditional → KILLED
    if (lastSpaceIndex == -1) {
280
      return ""; // No spaces found, return empty string
281
    }
282 1 1. getFirstName : replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getFirstName → KILLED
    return fullName.substring(0, lastSpaceIndex).trim(); // Return everything before the last space
283
  }
284
285
  /**
286
   * Get everything after the last space in the full name. If the string contains no spaces, return
287
   * the entire input string as the result.
288
   *
289
   * @param fullName
290
   * @return best estimate of last name
291
   */
292
  public static String getLastName(String fullName) {
293
    int lastSpaceIndex = fullName.lastIndexOf(" ");
294 1 1. getLastName : negated conditional → KILLED
    if (lastSpaceIndex == -1) {
295 1 1. getLastName : replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getLastName → KILLED
      return fullName; // No spaces found, return the entire string
296
    }
297 2 1. getLastName : Replaced integer addition with subtraction → KILLED
2. getLastName : replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getLastName → KILLED
    return fullName.substring(lastSpaceIndex + 1).trim(); // Return everything after the last space
298
  }
299
}

Mutations

89

1.1
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
changed conditional boundary → KILLED

2.2
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
negated conditional → KILLED

91

1.1
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
negated conditional → KILLED

2.2
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
changed conditional boundary → KILLED

92

1.1
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
negated conditional → KILLED

97

1.1
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
negated conditional → KILLED

98

1.1
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED

103

1.1
Location : getRosterSourceType
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getRosterSourceType()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED

130

1.1
Location : lambda$uploadRosterStudentsCSV$0
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:instructor_cannot_upload_students_for_a_course_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::lambda$uploadRosterStudentsCSV$0 → KILLED

133

1.1
Location : lambda$uploadRosterStudentsCSV$1
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:drops_handled_correctly()]
negated conditional → KILLED

2.2
Location : lambda$uploadRosterStudentsCSV$1
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:drops_handled_correctly()]
replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::lambda$uploadRosterStudentsCSV$1 → KILLED

134

1.1
Location : lambda$uploadRosterStudentsCSV$2
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:drops_handled_correctly()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED

2.2
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:drops_handled_correctly()]
removed call to java/util/stream/Stream::forEach → KILLED

145

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:unrecognized_csv_format_throws_an_exception()]
negated conditional → KILLED

148

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:students_with_non_matching_student_id_and_email_are_rejected()]
negated conditional → KILLED

149

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:students_with_non_matching_student_id_and_email_are_rejected()]
removed call to com/opencsv/CSVReader::skip → KILLED

156

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:students_with_non_matching_student_id_and_email_are_rejected()]
negated conditional → KILLED

160

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:instructor_can_upload_chico_roster_with_duplicate_row_for_new_student()]
negated conditional → KILLED

163

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
Replaced integer addition with subtraction → KILLED

167

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:students_with_non_matching_student_id_and_email_are_rejected()]
negated conditional → KILLED

170

1.1
Location : lambda$uploadRosterStudentsCSV$3
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::lambda$uploadRosterStudentsCSV$3 → KILLED

2.2
Location : lambda$uploadRosterStudentsCSV$3
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
negated conditional → KILLED

178

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:drops_handled_correctly()]
removed call to java/util/List::forEach → KILLED

180

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:instructor_can_upload_chico_roster_with_duplicate_row_for_new_student()]
removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUsersToRosterStudents → KILLED

188

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::uploadRosterStudentsCSV → KILLED

191

1.1
Location : uploadRosterStudentsCSV
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:students_with_non_matching_student_id_and_email_are_rejected()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::uploadRosterStudentsCSV → KILLED

196

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowUCSB_notEnoughColumns()]
negated conditional → KILLED

197

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowUCSB_sectionField_emailSanitized()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED

198

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState_notEnoughColumns()]
negated conditional → KILLED

199

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowChico_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED

200

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState_notEnoughColumns()]
negated conditional → KILLED

201

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED

202

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowRosterDownload_sectionField()]
negated conditional → KILLED

203

1.1
Location : fromCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowRosterDownload_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED

210

1.1
Location : checkRowLength
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState()]
changed conditional boundary → KILLED

2.2
Location : checkRowLength
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowUCSB_notEnoughColumns()]
negated conditional → KILLED

220

1.1
Location : fromUCSBEgradesCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowUCSB_notEnoughColumns()]
removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED

221

1.1
Location : fromUCSBEgradesCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowUCSB_sectionField_emailSanitized()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromUCSBEgradesCSVRow → KILLED

231

1.1
Location : fromChicoCanvasCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowChico_notEnoughColumns()]
removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED

232

1.1
Location : fromChicoCanvasCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowChico_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromChicoCanvasCSVRow → KILLED

243

1.1
Location : fromOregonStateCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState_notEnoughColumns()]
removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED

247

1.1
Location : fromOregonStateCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState_noComma()]
changed conditional boundary → KILLED

2.2
Location : fromOregonStateCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState()]
negated conditional → KILLED

248

1.1
Location : fromOregonStateCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowOregonState()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromOregonStateCSVRow → KILLED

260

1.1
Location : fromRosterDownloadCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowRosterDownload_notEnoughColumns()]
removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED

261

1.1
Location : fromRosterDownloadCSVRow
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowRosterDownload_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromRosterDownloadCSVRow → KILLED

279

1.1
Location : getFirstName
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getFirstname()]
negated conditional → KILLED

282

1.1
Location : getFirstName
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getFirstname()]
replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getFirstName → KILLED

294

1.1
Location : getLastName
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getLastName()]
negated conditional → KILLED

295

1.1
Location : getLastName
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getLastName()]
replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getLastName → KILLED

297

1.1
Location : getLastName
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getLastName()]
Replaced integer addition with subtraction → KILLED

2.2
Location : getLastName
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_getLastName()]
replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getLastName → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.0 support