CSVDownloadsController.java

1
package edu.ucsb.cs156.frontiers.controllers;
2
3
import com.opencsv.bean.StatefulBeanToCsv;
4
import com.opencsv.exceptions.CsvDataTypeMismatchException;
5
import com.opencsv.exceptions.CsvRequiredFieldEmptyException;
6
import edu.ucsb.cs156.frontiers.entities.Course;
7
import edu.ucsb.cs156.frontiers.entities.CourseStaff;
8
import edu.ucsb.cs156.frontiers.entities.RosterStudent;
9
import edu.ucsb.cs156.frontiers.enums.RosterStatus;
10
import edu.ucsb.cs156.frontiers.errors.EntityNotFoundException;
11
import edu.ucsb.cs156.frontiers.models.NameAndTeam;
12
import edu.ucsb.cs156.frontiers.models.RosterStudentDTO;
13
import edu.ucsb.cs156.frontiers.repositories.CourseRepository;
14
import edu.ucsb.cs156.frontiers.repositories.CourseStaffRepository;
15
import edu.ucsb.cs156.frontiers.repositories.RosterStudentRepository;
16
import edu.ucsb.cs156.frontiers.services.RosterStudentDTOService;
17
import edu.ucsb.cs156.frontiers.services.SectionTranslationService;
18
import edu.ucsb.cs156.frontiers.services.TeamCsvService;
19
import io.swagger.v3.oas.annotations.Operation;
20
import io.swagger.v3.oas.annotations.Parameter;
21
import io.swagger.v3.oas.annotations.media.Content;
22
import io.swagger.v3.oas.annotations.media.Schema;
23
import io.swagger.v3.oas.annotations.responses.ApiResponse;
24
import io.swagger.v3.oas.annotations.tags.Tag;
25
import java.io.IOException;
26
import java.io.OutputStreamWriter;
27
import java.io.Writer;
28
import java.nio.charset.StandardCharsets;
29
import java.util.List;
30
import java.util.Map;
31
import lombok.extern.slf4j.Slf4j;
32
import org.apache.commons.csv.CSVFormat;
33
import org.apache.commons.csv.CSVPrinter;
34
import org.springframework.beans.factory.annotation.Autowired;
35
import org.springframework.http.HttpHeaders;
36
import org.springframework.http.MediaType;
37
import org.springframework.http.ResponseEntity;
38
import org.springframework.security.access.prepost.PreAuthorize;
39
import org.springframework.web.bind.annotation.GetMapping;
40
import org.springframework.web.bind.annotation.RequestMapping;
41
import org.springframework.web.bind.annotation.RequestParam;
42
import org.springframework.web.bind.annotation.RestController;
43
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
44
45
@Tag(name = "CSV Downloads")
46
@RequestMapping("/api/csv")
47
@RestController
48
@Slf4j
49
public class CSVDownloadsController extends ApiController {
50
51
  @Autowired private CourseRepository courseRepository;
52
53
  @Autowired private RosterStudentDTOService rosterStudentDTOService;
54
55
  @Autowired private RosterStudentRepository rosterStudentRepository;
56
57
  @Autowired private CourseStaffRepository courseStaffRepository;
58
59
  @Autowired private SectionTranslationService sectionTranslationService;
60
61
  @Autowired private TeamCsvService teamCsvService;
62
63
  @Operation(
64
      summary = "Download CSV File of Roster Students",
65
      description = "Returns a CSV file as a response",
66
      responses = {
67
        @ApiResponse(
68
            responseCode = "200",
69
            description = "CSV file",
70
            content =
71
                @Content(
72
                    mediaType = "text/csv",
73
                    schema = @Schema(type = "string", format = "binary"))),
74
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
75
      })
76
  @GetMapping(value = "/rosterstudents", produces = "text/csv")
77
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
78
  public ResponseEntity<StreamingResponseBody> csvForQuarter(
79
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
80
          Long courseId)
81
      throws EntityNotFoundException, Exception, IOException {
82
    Course course =
83
        courseRepository
84
            .findById(courseId)
85 1 1. lambda$csvForQuarter$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$csvForQuarter$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
86
    StreamingResponseBody stream =
87
        (outputStream) -> {
88
          List<RosterStudentDTO> list = rosterStudentDTOService.getRosterStudentDTOs(courseId);
89
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) {
90
            try {
91
              StatefulBeanToCsv<RosterStudentDTO> beanToCsvWriter =
92
                  rosterStudentDTOService.getStatefulBeanToCSV(writer);
93 1 1. lambda$csvForQuarter$1 : removed call to com/opencsv/bean/StatefulBeanToCsv::write → KILLED
              beanToCsvWriter.write(list);
94
            } catch (CsvDataTypeMismatchException | CsvRequiredFieldEmptyException e) {
95
              log.error("Error writing CSV file", e);
96
              throw new IOException("Error writing CSV file: " + e.getMessage());
97
            }
98
          }
99
        };
100
101 1 1. csvForQuarter : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::csvForQuarter → KILLED
    return ResponseEntity.ok()
102
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
103
        .header(
104
            HttpHeaders.CONTENT_DISPOSITION,
105
            String.format("attachment;filename=%s_roster.csv", course.getCourseName()))
106
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
107
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
108
        .body(stream);
109
  }
110
111
  @Operation(
112
      summary = "Download CSV File of Course Staff",
113
      description =
114
          "Returns a CSV file of the course's staff, one row per staff member, with the header "
115
              + CourseStaffCSVController.STAFF_CSV_HEADERS
116
              + ". This is the format that Upload Staff CSV (POST /api/coursestaff/upload/csv)"
117
              + " accepts, so the file can be uploaded to another course.",
118
      responses = {
119
        @ApiResponse(
120
            responseCode = "200",
121
            description = "CSV file",
122
            content =
123
                @Content(
124
                    mediaType = "text/csv",
125
                    schema = @Schema(type = "string", format = "binary"))),
126
        @ApiResponse(responseCode = "404", description = "Course not found"),
127
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
128
      })
129
  @GetMapping(value = "/staff", produces = "text/csv")
130
  @PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)")
131
  public ResponseEntity<StreamingResponseBody> staffCsv(
132
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
133
          Long courseId)
134
      throws EntityNotFoundException {
135
    Course course =
136
        courseRepository
137
            .findById(courseId)
138 1 1. lambda$staffCsv$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$staffCsv$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
139
    StreamingResponseBody stream =
140
        (outputStream) -> {
141
          Iterable<CourseStaff> staff = courseStaffRepository.findByCourseId(courseId);
142
          CSVFormat format =
143
              CSVFormat.DEFAULT
144
                  .builder()
145
                  .setHeader(CourseStaffCSVController.STAFF_CSV_HEADERS.split(","))
146
                  .build();
147
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
148
              CSVPrinter csvPrinter = new CSVPrinter(writer, format)) {
149
            for (CourseStaff staffMember : staff) {
150 1 1. lambda$staffCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
              csvPrinter.printRecord(
151
                  staffMember.getFirstName(), staffMember.getLastName(), staffMember.getEmail());
152
            }
153
          }
154
        };
155
156 1 1. staffCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::staffCsv → KILLED
    return ResponseEntity.ok()
157
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
158
        .header(
159
            HttpHeaders.CONTENT_DISPOSITION,
160
            String.format("attachment;filename=%s_staff.csv", course.getCourseName()))
161
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
162
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
163
        .body(stream);
164
  }
165
166
  @Operation(
167
      summary = "Download CATME CSV File of Roster Students",
168
      description = "Returns a CSV file as a response",
169
      responses = {
170
        @ApiResponse(
171
            responseCode = "200",
172
            description = "CSV file",
173
            content =
174
                @Content(
175
                    mediaType = "text/csv",
176
                    schema = @Schema(type = "string", format = "binary"))),
177
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
178
      })
179
  @GetMapping(value = "/catme", produces = "text/csv")
180
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
181
  public ResponseEntity<StreamingResponseBody> catmeCsv(
182
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
183
          Long courseId)
184
      throws EntityNotFoundException {
185
    Course course =
186
        courseRepository
187
            .findById(courseId)
188 1 1. lambda$catmeCsv$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$catmeCsv$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
189
    StreamingResponseBody stream =
190
        (outputStream) -> {
191
          List<RosterStudent> rosterStudents =
192
              rosterStudentRepository
193
                  .findByCourseIdAndRosterStatusInOrderByFirstNameAscLastNameAscIgnoreCase(
194
                      courseId, List.of(RosterStatus.ROSTER, RosterStatus.MANUAL));
195
          Map<String, String> sectionTranslations =
196
              sectionTranslationService.getSectionTranslations(courseId);
197
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
198
              CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.DEFAULT)) {
199 1 1. lambda$catmeCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
            csvPrinter.printRecord("first", "last", "email", "id", "section", "team");
200
            for (RosterStudent student : rosterStudents) {
201
              List<String> teams = student.getTeams();
202 2 1. lambda$catmeCsv$1 : negated conditional → KILLED
2. lambda$catmeCsv$1 : negated conditional → KILLED
              String team = teams != null && !teams.isEmpty() ? teams.get(0) : "";
203 1 1. lambda$catmeCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
              csvPrinter.printRecord(
204
                  student.getFirstName(),
205
                  student.getLastName(),
206
                  student.getEmail(),
207
                  student.getStudentId(),
208
                  SectionTranslationService.translateSection(
209
                      student.getSection(), sectionTranslations),
210
                  team);
211
            }
212
          }
213
        };
214
215 1 1. catmeCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::catmeCsv → KILLED
    return ResponseEntity.ok()
216
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
217
        .header(
218
            HttpHeaders.CONTENT_DISPOSITION,
219
            String.format("attachment;filename=%s_catme.csv", course.getCourseName()))
220
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
221
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
222
        .body(stream);
223
  }
224
225
  @Operation(
226
      summary = "Download compact Name to Team CSV File",
227
      description =
228
          "Returns a CSV file with the roster laid out in several side-by-side Name,Team column"
229
              + " pairs. Names are sorted by first name and abbreviated as far as possible while"
230
              + " remaining unique (first name; first name plus last initial; first name plus last"
231
              + " name). Exact duplicate names are marked with an asterisk.",
232
      responses = {
233
        @ApiResponse(
234
            responseCode = "200",
235
            description = "CSV file",
236
            content =
237
                @Content(
238
                    mediaType = "text/csv",
239
                    schema = @Schema(type = "string", format = "binary"))),
240
        @ApiResponse(responseCode = "400", description = "columns is less than 1"),
241
        @ApiResponse(responseCode = "404", description = "Course not found"),
242
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
243
      })
244
  @GetMapping(value = "/name2team", produces = "text/csv")
245
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
246
  public ResponseEntity<StreamingResponseBody> name2TeamCsv(
247
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
248
          Long courseId,
249
      @Parameter(
250
              name = "columns",
251
              description = "number of Name,Team column pairs (default 4)",
252
              example = "4")
253
          @RequestParam(defaultValue = "4")
254
          int columns)
255
      throws EntityNotFoundException {
256 1 1. name2TeamCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::name2TeamCsv → KILLED
    return teamCsvResponse(courseId, columns, "name2team", teamCsvService::writeName2TeamCsv);
257
  }
258
259
  @Operation(
260
      summary = "Download compact Team Table CSV File",
261
      description =
262
          "Returns a CSV file with the teams laid out in several side-by-side Team,Name column"
263
              + " pairs, one row per student, teams sorted by name and balanced across the columns"
264
              + " so that no team is split. Names are sorted by first name and abbreviated as far"
265
              + " as possible while remaining unique (first name; first name plus last initial;"
266
              + " first name plus last name). Exact duplicate names are marked with an asterisk."
267
              + " Students with no team are listed last with a blank team.",
268
      responses = {
269
        @ApiResponse(
270
            responseCode = "200",
271
            description = "CSV file",
272
            content =
273
                @Content(
274
                    mediaType = "text/csv",
275
                    schema = @Schema(type = "string", format = "binary"))),
276
        @ApiResponse(responseCode = "400", description = "columns is less than 1"),
277
        @ApiResponse(responseCode = "404", description = "Course not found"),
278
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
279
      })
280
  @GetMapping(value = "/teamtable", produces = "text/csv")
281
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
282
  public ResponseEntity<StreamingResponseBody> teamTableCsv(
283
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
284
          Long courseId,
285
      @Parameter(
286
              name = "columns",
287
              description = "number of Team,Name column pairs (default 4)",
288
              example = "4")
289
          @RequestParam(defaultValue = "4")
290
          int columns)
291
      throws EntityNotFoundException {
292 1 1. teamTableCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamTableCsv → KILLED
    return teamCsvResponse(courseId, columns, "teamtable", teamCsvService::writeTeamTableCsv);
293
  }
294
295
  @Operation(
296
      summary = "Download formatted Teams CSV File",
297
      description =
298
          "Returns a CSV file with two tables, each preceded by a title line. \"by name\" lists"
299
              + " every student in Name,Team column pairs of "
300
              + TeamCsvService.NAMES_PER_COLUMN
301
              + " students each; \"by team\" lists the teams and their members in Team,Name"
302
              + " column pairs of "
303
              + TeamCsvService.TEAMS_PER_COLUMN
304
              + " teams each, so that no team is split. Both use as many columns as needed."
305
              + " Names are sorted by first name and abbreviated as far as possible while"
306
              + " remaining unique (first name; first name plus last initial; first name plus last"
307
              + " name). Exact duplicate names are marked with an asterisk. Students with no team"
308
              + " are listed last in the \"by team\" table, with a blank team. Imported into a"
309
              + " spreadsheet, the file only needs formatting and splitting into two tabs.",
310
      responses = {
311
        @ApiResponse(
312
            responseCode = "200",
313
            description = "CSV file",
314
            content =
315
                @Content(
316
                    mediaType = "text/csv",
317
                    schema = @Schema(type = "string", format = "binary"))),
318
        @ApiResponse(responseCode = "404", description = "Course not found"),
319
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
320
      })
321
  @GetMapping(value = "/formattedteams", produces = "text/csv")
322
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
323
  public ResponseEntity<StreamingResponseBody> formattedTeamsCsv(
324
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
325
          Long courseId)
326
      throws EntityNotFoundException {
327
    Course course =
328
        courseRepository
329
            .findById(courseId)
330 1 1. lambda$formattedTeamsCsv$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$formattedTeamsCsv$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
331 1 1. formattedTeamsCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::formattedTeamsCsv → KILLED
    return teamCsvResponse(course, "formatted_teams", teamCsvService::writeFormattedTeamsCsv);
332
  }
333
334
  /** Writes one of the compact team CSV tables from a list of abbreviated names and teams. */
335
  @FunctionalInterface
336
  interface TeamCsvWriter {
337
    void write(Writer writer, List<NameAndTeam> entries, int columns) throws IOException;
338
  }
339
340
  /** Writes a team CSV file that has no column count from a list of abbreviated names and teams. */
341
  @FunctionalInterface
342
  interface TeamCsvFileWriter {
343
    void write(Writer writer, List<NameAndTeam> entries) throws IOException;
344
  }
345
346
  /**
347
   * Shared response for the compact team CSV downloads that take a column count: looks up the
348
   * course and validates the column count before streaming the table written by the given writer
349
   * (see {@link #teamCsvResponse(Course, String, TeamCsvFileWriter)}).
350
   *
351
   * @param courseId the course id
352
   * @param columns the number of column pairs, at least 1
353
   * @param suffix the file name suffix, e.g. "name2team" gives "&lt;courseName&gt;_name2team.csv"
354
   * @param csvWriter writes the table
355
   * @return the streaming CSV response
356
   * @throws EntityNotFoundException if the course does not exist
357
   * @throws IllegalArgumentException if columns is less than 1
358
   */
359
  private ResponseEntity<StreamingResponseBody> teamCsvResponse(
360
      Long courseId, int columns, String suffix, TeamCsvWriter csvWriter)
361
      throws EntityNotFoundException {
362
    Course course =
363
        courseRepository
364
            .findById(courseId)
365 1 1. lambda$teamCsvResponse$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$teamCsvResponse$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
366 2 1. teamCsvResponse : negated conditional → KILLED
2. teamCsvResponse : changed conditional boundary → KILLED
    if (columns < 1) {
367
      throw new IllegalArgumentException("columns must be at least 1");
368
    }
369 1 1. teamCsvResponse : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamCsvResponse → KILLED
    return teamCsvResponse(
370 1 1. lambda$teamCsvResponse$1 : removed call to edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController$TeamCsvWriter::write → KILLED
        course, suffix, (writer, entries) -> csvWriter.write(writer, entries, columns));
371
  }
372
373
  /**
374
   * Shared response for the team CSV downloads of an existing course: loads the ROSTER and MANUAL
375
   * students sorted by first name, abbreviates their names and streams the file written by the
376
   * given writer.
377
   *
378
   * @param course the course
379
   * @param suffix the file name suffix, e.g. "name2team" gives "&lt;courseName&gt;_name2team.csv"
380
   * @param csvWriter writes the file
381
   * @return the streaming CSV response
382
   */
383
  private ResponseEntity<StreamingResponseBody> teamCsvResponse(
384
      Course course, String suffix, TeamCsvFileWriter csvWriter) {
385
    StreamingResponseBody stream =
386
        (outputStream) -> {
387
          List<RosterStudent> rosterStudents =
388
              rosterStudentRepository
389
                  .findByCourseIdAndRosterStatusInOrderByFirstNameAscLastNameAscIgnoreCase(
390
                      course.getId(), List.of(RosterStatus.ROSTER, RosterStatus.MANUAL));
391
          List<NameAndTeam> entries = teamCsvService.nameAndTeams(rosterStudents);
392
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) {
393 1 1. lambda$teamCsvResponse$2 : removed call to edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController$TeamCsvFileWriter::write → KILLED
            csvWriter.write(writer, entries);
394
          }
395
        };
396
397 1 1. teamCsvResponse : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamCsvResponse → KILLED
    return ResponseEntity.ok()
398
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
399
        .header(
400
            HttpHeaders.CONTENT_DISPOSITION,
401
            String.format("attachment;filename=%s_%s.csv", course.getCourseName(), suffix))
402
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
403
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
404
        .body(stream);
405
  }
406
}

Mutations

85

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

93

1.1
Location : lambda$csvForQuarter$1
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:mockMvcSRBTest()]
removed call to com/opencsv/bean/StatefulBeanToCsv::write → KILLED

101

1.1
Location : csvForQuarter
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_csv_exception()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::csvForQuarter → KILLED

138

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

150

1.1
Location : lambda$staffCsv$1
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_staff_csv_in_the_upload_format()]
removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED

156

1.1
Location : staffCsv
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_staff_csv_of_a_course_with_no_staff_is_just_the_header()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::staffCsv → KILLED

188

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

199

1.1
Location : lambda$catmeCsv$1
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_catme_csv_uses_raw_sections_when_option_explicitly_disabled()]
removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED

202

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

2.2
Location : lambda$catmeCsv$1
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_catme_csv_filters_to_roster_and_manual()]
negated conditional → KILLED

203

1.1
Location : lambda$catmeCsv$1
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_catme_csv_uses_raw_sections_when_option_explicitly_disabled()]
removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED

215

1.1
Location : catmeCsv
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_catme_csv_uses_raw_sections_when_option_explicitly_disabled()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::catmeCsv → KILLED

256

1.1
Location : name2TeamCsv
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_name2team_csv_with_one_column()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::name2TeamCsv → KILLED

292

1.1
Location : teamTableCsv
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_teamtable_csv_with_one_column()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamTableCsv → KILLED

330

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

331

1.1
Location : formattedTeamsCsv
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_formattedteams_csv()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::formattedTeamsCsv → KILLED

365

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

366

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

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

369

1.1
Location : teamCsvResponse
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_name2team_csv_with_one_column()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamCsvResponse → KILLED

370

1.1
Location : lambda$teamCsvResponse$1
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_name2team_csv_with_one_column()]
removed call to edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController$TeamCsvWriter::write → KILLED

393

1.1
Location : lambda$teamCsvResponse$2
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_name2team_csv_with_one_column()]
removed call to edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController$TeamCsvFileWriter::write → KILLED

397

1.1
Location : teamCsvResponse
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_name2team_csv_with_one_column()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamCsvResponse → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.0 support