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
  @Autowired private OrganizationMemberService organizationMemberService;
56
  @Autowired private StudentDropService studentDropService;
57
  @Autowired private JobService jobService;
58
59
  public enum RosterSourceType {
60
    UCSB_EGRADES,
61
    CHICO_CANVAS,
62
    OREGON_STATE,
63
    ROSTER_DOWNLOAD,
64
    UNKNOWN
65
  }
66
67
  public static final String UCSB_EGRADES_HEADERS =
68
      "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";
69
  public static final String CHICO_CANVAS_HEADERS =
70
      "Student Name,Student ID,Student SIS ID,Email,Section Name";
71
  public static final String OREGON_STATE_HEADERS =
72
      "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";
73
  public static final String ROSTER_DOWNLOAD_HEADERS =
74
      "COURSEID,EMAIL,FIRSTNAME,GITHUBID,GITHUBLOGIN,ID,LASTNAME,ORGSTATUS,ROSTERSTATUS,SECTION,STUDENTID,TEAMS,USERID";
75
76
  public static RosterSourceType getRosterSourceType(String[] headers) {
77
78
    Map<RosterSourceType, String[]> sourceTypeToHeaders = new HashMap<>();
79
80
    sourceTypeToHeaders.put(RosterSourceType.UCSB_EGRADES, UCSB_EGRADES_HEADERS.split(","));
81
    sourceTypeToHeaders.put(RosterSourceType.CHICO_CANVAS, CHICO_CANVAS_HEADERS.split(","));
82
    sourceTypeToHeaders.put(RosterSourceType.OREGON_STATE, OREGON_STATE_HEADERS.split(","));
83
    sourceTypeToHeaders.put(RosterSourceType.ROSTER_DOWNLOAD, ROSTER_DOWNLOAD_HEADERS.split(","));
84
85
    for (Map.Entry<RosterSourceType, String[]> entry : sourceTypeToHeaders.entrySet()) {
86
      RosterSourceType type = entry.getKey();
87
      String[] expectedHeaders = entry.getValue();
88 2 1. getRosterSourceType : changed conditional boundary → KILLED
2. getRosterSourceType : negated conditional → KILLED
      if (headers.length >= expectedHeaders.length) {
89
        boolean matches = true;
90 2 1. getRosterSourceType : negated conditional → KILLED
2. getRosterSourceType : changed conditional boundary → KILLED
        for (int i = 0; i < expectedHeaders.length; i++) {
91 1 1. getRosterSourceType : negated conditional → KILLED
          if (!expectedHeaders[i].trim().equalsIgnoreCase(headers[i].trim())) {
92
            matches = false;
93
            break;
94
          }
95
        }
96 1 1. getRosterSourceType : negated conditional → KILLED
        if (matches) {
97 1 1. getRosterSourceType : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED
          return type;
98
        }
99
      }
100
    }
101
    // If no known type matches, return UNKNOWN
102 1 1. getRosterSourceType : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED
    return RosterSourceType.UNKNOWN;
103
  }
104
105
  /**
106
   * Upload Roster students for Course in any supported format. It is important to keep the code in
107
   * this method consistent with the code for adding a single roster student
108
   *
109
   * @param courseId
110
   * @param file
111
   * @return
112
   * @throws JsonProcessingException
113
   * @throws IOException
114
   * @throws CsvException
115
   */
116
  @Operation(summary = "Upload Roster students for Course in any supported Format")
117
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
118
  @PostMapping(
119
      value = "/upload/csv",
120
      consumes = {"multipart/form-data"})
121
  public ResponseEntity<LoadResult> uploadRosterStudentsCSV(
122
      @Parameter(name = "courseId") @RequestParam Long courseId,
123
      @Parameter(name = "file") @RequestParam("file") MultipartFile file)
124
      throws JsonProcessingException, IOException, CsvException {
125
126
    Course course =
127
        courseRepository
128
            .findById(courseId)
129 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()));
130
131
    course.getRosterStudents().stream()
132 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)
133 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));
134
135
    int counts[] = {0, 0};
136
    List<RosterStudent> rejectedStudents = new ArrayList<>();
137
138
    try (InputStream inputStream = new BufferedInputStream(file.getInputStream());
139
        InputStreamReader reader = new InputStreamReader(inputStream);
140
        CSVReader csvReader = new CSVReader(reader); ) {
141
142
      String[] headers = csvReader.readNext();
143
      RosterSourceType sourceType = getRosterSourceType(headers);
144 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
      if (sourceType == RosterSourceType.UNKNOWN) {
145
        throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Unknown Roster Source Type");
146
      }
147 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
      if (sourceType == RosterSourceType.UCSB_EGRADES) {
148 1 1. uploadRosterStudentsCSV : removed call to com/opencsv/CSVReader::skip → KILLED
        csvReader.skip(1);
149
      }
150
      List<String[]> myEntries = csvReader.readAll();
151
      for (String[] row : myEntries) {
152
        RosterStudent rosterStudent = fromCSVRow(row, sourceType);
153
        UpsertResponse upsertResponse =
154
            RosterStudentsController.upsertStudent(rosterStudent, course, RosterStatus.ROSTER);
155 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
        if (upsertResponse.getInsertStatus() == InsertStatus.REJECTED) {
156
          rejectedStudents.add(upsertResponse.rosterStudent());
157
        } else {
158
          InsertStatus s = upsertResponse.getInsertStatus();
159 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
          if (s == InsertStatus.INSERTED) {
160
            course.getRosterStudents().add(upsertResponse.rosterStudent());
161
          }
162 1 1. uploadRosterStudentsCSV : Replaced integer addition with subtraction → KILLED
          counts[s.ordinal()]++;
163
        }
164
      }
165
    }
166 1 1. uploadRosterStudentsCSV : negated conditional → KILLED
    if (rejectedStudents.isEmpty()) {
167
      List<RosterStudent> droppedStudents =
168
          course.getRosterStudents().stream()
169 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)
170
              .toList();
171
      LoadResult successfulResult =
172
          new LoadResult(
173
              counts[InsertStatus.INSERTED.ordinal()],
174
              counts[InsertStatus.UPDATED.ordinal()],
175
              droppedStudents.size(),
176
              List.of());
177
      rosterStudentRepository.saveAll(course.getRosterStudents());
178 1 1. uploadRosterStudentsCSV : removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUsersToRosterStudents → KILLED
      updateUserService.attachUsersToRosterStudents(course.getRosterStudents());
179 1 1. uploadRosterStudentsCSV : removed call to edu/ucsb/cs156/frontiers/services/StudentDropService::handleDroppedStudents → KILLED
      studentDropService.handleDroppedStudents(droppedStudents);
180
      RemoveStudentsJob job =
181
          RemoveStudentsJob.builder()
182
              .students(droppedStudents)
183
              .organizationMemberService(organizationMemberService)
184
              .rosterStudentRepository(rosterStudentRepository)
185
              .build();
186
      jobService.runAsJob(job);
187 1 1. uploadRosterStudentsCSV : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::uploadRosterStudentsCSV → KILLED
      return ResponseEntity.ok(successfulResult);
188
    } else {
189
      LoadResult conflictResult = new LoadResult(0, 0, 0, rejectedStudents);
190 1 1. uploadRosterStudentsCSV : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::uploadRosterStudentsCSV → KILLED
      return ResponseEntity.status(HttpStatus.CONFLICT).body(conflictResult);
191
    }
192
  }
193
194
  public static RosterStudent fromCSVRow(String[] row, RosterSourceType sourceType) {
195 1 1. fromCSVRow : negated conditional → KILLED
    if (sourceType == RosterSourceType.UCSB_EGRADES) {
196 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromUCSBEgradesCSVRow(row);
197 1 1. fromCSVRow : negated conditional → KILLED
    } else if (sourceType == RosterSourceType.CHICO_CANVAS) {
198 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromChicoCanvasCSVRow(row);
199 1 1. fromCSVRow : negated conditional → KILLED
    } else if (sourceType == RosterSourceType.OREGON_STATE) {
200 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromOregonStateCSVRow(row);
201 1 1. fromCSVRow : negated conditional → KILLED
    } else if (sourceType == RosterSourceType.ROSTER_DOWNLOAD) {
202 1 1. fromCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED
      return fromRosterDownloadCSVRow(row);
203
    } else {
204
      throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "CSV format not recognized");
205
    }
206
  }
207
208
  public static void checkRowLength(String[] row, int expectedLength, RosterSourceType sourceType) {
209 2 1. checkRowLength : changed conditional boundary → KILLED
2. checkRowLength : negated conditional → KILLED
    if (row.length < expectedLength) {
210
      throw new ResponseStatusException(
211
          HttpStatus.BAD_REQUEST,
212
          String.format(
213
              "%s CSV row does not have enough columns. Length = %d Row content = [%s]",
214
              sourceType.toString(), row.length, Arrays.toString(row)));
215
    }
216
  }
217
218
  public static RosterStudent fromUCSBEgradesCSVRow(String[] row) {
219 1 1. fromUCSBEgradesCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 11, RosterSourceType.UCSB_EGRADES);
220 1 1. fromUCSBEgradesCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromUCSBEgradesCSVRow → KILLED
    return RosterStudent.builder()
221
        .firstName(row[5])
222
        .lastName(row[4])
223
        .studentId(row[1])
224
        .email(row[10].strip())
225
        .section(row[0])
226
        .build();
227
  }
228
229
  public static RosterStudent fromChicoCanvasCSVRow(String[] row) {
230 1 1. fromChicoCanvasCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 4, RosterSourceType.CHICO_CANVAS);
231 1 1. fromChicoCanvasCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromChicoCanvasCSVRow → KILLED
    return RosterStudent.builder()
232
        .firstName(getFirstName(row[0]))
233
        .lastName(getLastName(row[0]))
234
        .studentId(row[2])
235
        .email(row[3].strip())
236
        .section("")
237
        .build();
238
  }
239
240
  public static RosterStudent fromOregonStateCSVRow(String[] row) {
241
242 1 1. fromOregonStateCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 10, RosterSourceType.OREGON_STATE);
243
    String sortableName = row[1];
244
    String sortableNameParts[] = sortableName.split(",");
245
    String lastName = sortableNameParts[0].trim();
246 2 1. fromOregonStateCSVRow : changed conditional boundary → KILLED
2. fromOregonStateCSVRow : negated conditional → KILLED
    String firstName = sortableNameParts.length > 1 ? sortableNameParts[1].trim() : "";
247 1 1. fromOregonStateCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromOregonStateCSVRow → KILLED
    return RosterStudent.builder()
248
        .firstName(firstName)
249
        .lastName(lastName)
250
        .studentId(row[9])
251
        .email(row[8].strip())
252
        .section("")
253
        .build();
254
  }
255
256
  public static RosterStudent fromRosterDownloadCSVRow(String[] row) {
257
    // Header order: COURSEID, EMAIL, FIRSTNAME, GITHUBID, GITHUBLOGIN, ID, LASTNAME,
258
    // ORGSTATUS, ROSTERSTATUS, SECTION, STUDENTID, TEAMS, USERID
259 1 1. fromRosterDownloadCSVRow : removed call to edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::checkRowLength → KILLED
    checkRowLength(row, 13, RosterSourceType.ROSTER_DOWNLOAD);
260 1 1. fromRosterDownloadCSVRow : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromRosterDownloadCSVRow → KILLED
    return RosterStudent.builder()
261
        .firstName(row[2])
262
        .lastName(row[6])
263
        .studentId(row[10])
264
        .email(row[1].strip())
265
        .section(row[9])
266
        .build();
267
  }
268
269
  /**
270
   * Get everything except up to and not including the last space in the full name. If the string
271
   * contains no spaces, return an empty string.
272
   *
273
   * @param fullName
274
   * @return
275
   */
276
  public static String getFirstName(String fullName) {
277
    int lastSpaceIndex = fullName.lastIndexOf(" ");
278 1 1. getFirstName : negated conditional → KILLED
    if (lastSpaceIndex == -1) {
279
      return ""; // No spaces found, return empty string
280
    }
281 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
282
  }
283
284
  /**
285
   * Get everything after the last space in the full name. If the string contains no spaces, return
286
   * the entire input string as the result.
287
   *
288
   * @param fullName
289
   * @return best estimate of last name
290
   */
291
  public static String getLastName(String fullName) {
292
    int lastSpaceIndex = fullName.lastIndexOf(" ");
293 1 1. getLastName : negated conditional → KILLED
    if (lastSpaceIndex == -1) {
294 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
295
    }
296 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
297
  }
298
}

Mutations

88

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

90

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

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

96

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()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getRosterSourceType → KILLED

102

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

129

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

132

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

133

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

144

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

147

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

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()]
removed call to com/opencsv/CSVReader::skip → KILLED

155

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

159

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

162

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

166

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

169

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:instructor_can_upload_chico_roster_with_duplicate_row_for_new_student()]
removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUsersToRosterStudents → KILLED

179

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 edu/ucsb/cs156/frontiers/services/StudentDropService::handleDroppedStudents → KILLED

187

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

190

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

195

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

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_sectionField_emailSanitized()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → 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_fromCSVRowOregonState_notEnoughColumns()]
negated conditional → 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_fromCSVRowChico_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → 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_fromCSVRowOregonState_notEnoughColumns()]
negated conditional → 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()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → 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_fromCSVRowRosterDownload_sectionField()]
negated conditional → 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()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromCSVRow → KILLED

209

1.1
Location : checkRowLength
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:test_fromCSVRowRosterDownload_sectionField()]
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_fromCSVRowRosterDownload_notEnoughColumns()]
negated conditional → KILLED

219

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

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_sectionField_emailSanitized()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromUCSBEgradesCSVRow → KILLED

230

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

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_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromChicoCanvasCSVRow → KILLED

242

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

246

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

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()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromOregonStateCSVRow → KILLED

259

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

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_sectionField()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::fromRosterDownloadCSVRow → KILLED

278

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

281

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

293

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

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()]
replaced return value with "" for edu/ucsb/cs156/frontiers/controllers/RosterStudentsCSVController::getLastName → KILLED

296

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