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 CourseStaffRepository courseStaffRepository;
56
57
  @Autowired private RosterStudentRepository rosterStudentRepository;
58
59
  @Autowired private SectionTranslationService sectionTranslationService;
60
61
  @Autowired private TeamCsvService teamCsvService;
62
63
  @Operation(
64
      summary = "Download CSV File of Course Staff",
65
      description = "Returns a CSV file containing course staff")
66
  // TODO: ADD REMAINING CSV STUFF FROM BELOW
67
  @GetMapping(value = "/coursestaff", produces = "text/csv")
68
  @PreAuthorize("@CourseSecurity.hasInstructorPermissions(#root, #courseId)")
69
  public ResponseEntity<StreamingResponseBody> courseStaffCsv(
70
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
71
          Long courseId)
72
      throws EntityNotFoundException {
73
    Course course =
74
        courseRepository
75
            .findById(courseId)
76 1 1. lambda$courseStaffCsv$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$courseStaffCsv$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
77
    StreamingResponseBody stream =
78
        (outputStream) -> {
79
          Iterable<CourseStaff> staff = courseStaffRepository.findByCourseId(courseId);
80
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
81
              CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.DEFAULT)) {
82 1 1. lambda$courseStaffCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
            csvPrinter.printRecord("firstName", "lastName", "email");
83
            for (CourseStaff member : staff) {
84 1 1. lambda$courseStaffCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
              csvPrinter.printRecord(
85
                  member.getFirstName(), member.getLastName(), member.getEmail());
86
            }
87
          }
88
        };
89
90 1 1. courseStaffCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::courseStaffCsv → KILLED
    return ResponseEntity.ok()
91
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
92
        .header(
93
            HttpHeaders.CONTENT_DISPOSITION,
94
            String.format("attachment;filename=%s_coursestaff.csv", course.getCourseName()))
95
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
96
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
97
        .body(stream);
98
  }
99
100
  @Operation(
101
      summary = "Download CSV File of Roster Students",
102
      description = "Returns a CSV file as a response",
103
      responses = {
104
        @ApiResponse(
105
            responseCode = "200",
106
            description = "CSV file",
107
            content =
108
                @Content(
109
                    mediaType = "text/csv",
110
                    schema = @Schema(type = "string", format = "binary"))),
111
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
112
      })
113
  @GetMapping(value = "/rosterstudents", produces = "text/csv")
114
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
115
  public ResponseEntity<StreamingResponseBody> csvForQuarter(
116
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
117
          Long courseId)
118
      throws EntityNotFoundException, Exception, IOException {
119
    Course course =
120
        courseRepository
121
            .findById(courseId)
122 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));
123
    StreamingResponseBody stream =
124
        (outputStream) -> {
125
          List<RosterStudentDTO> list = rosterStudentDTOService.getRosterStudentDTOs(courseId);
126
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) {
127
            try {
128
              StatefulBeanToCsv<RosterStudentDTO> beanToCsvWriter =
129
                  rosterStudentDTOService.getStatefulBeanToCSV(writer);
130 1 1. lambda$csvForQuarter$1 : removed call to com/opencsv/bean/StatefulBeanToCsv::write → KILLED
              beanToCsvWriter.write(list);
131
            } catch (CsvDataTypeMismatchException | CsvRequiredFieldEmptyException e) {
132
              log.error("Error writing CSV file", e);
133
              throw new IOException("Error writing CSV file: " + e.getMessage());
134
            }
135
          }
136
        };
137
138 1 1. csvForQuarter : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::csvForQuarter → KILLED
    return ResponseEntity.ok()
139
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
140
        .header(
141
            HttpHeaders.CONTENT_DISPOSITION,
142
            String.format("attachment;filename=%s_roster.csv", course.getCourseName()))
143
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
144
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
145
        .body(stream);
146
  }
147
148
  @Operation(
149
      summary = "Download CATME CSV File of Roster Students",
150
      description = "Returns a CSV file as a response",
151
      responses = {
152
        @ApiResponse(
153
            responseCode = "200",
154
            description = "CSV file",
155
            content =
156
                @Content(
157
                    mediaType = "text/csv",
158
                    schema = @Schema(type = "string", format = "binary"))),
159
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
160
      })
161
  @GetMapping(value = "/catme", produces = "text/csv")
162
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
163
  public ResponseEntity<StreamingResponseBody> catmeCsv(
164
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
165
          Long courseId)
166
      throws EntityNotFoundException {
167
    Course course =
168
        courseRepository
169
            .findById(courseId)
170 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));
171
    StreamingResponseBody stream =
172
        (outputStream) -> {
173
          List<RosterStudent> rosterStudents =
174
              rosterStudentRepository
175
                  .findByCourseIdAndRosterStatusInOrderByFirstNameAscLastNameAscIgnoreCase(
176
                      courseId, List.of(RosterStatus.ROSTER, RosterStatus.MANUAL));
177
          Map<String, String> sectionTranslations =
178
              sectionTranslationService.getSectionTranslations(courseId);
179
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8);
180
              CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.DEFAULT)) {
181 1 1. lambda$catmeCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
            csvPrinter.printRecord("first", "last", "email", "id", "section", "team");
182
            for (RosterStudent student : rosterStudents) {
183
              List<String> teams = student.getTeams();
184 2 1. lambda$catmeCsv$1 : negated conditional → KILLED
2. lambda$catmeCsv$1 : negated conditional → KILLED
              String team = teams != null && !teams.isEmpty() ? teams.get(0) : "";
185 1 1. lambda$catmeCsv$1 : removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED
              csvPrinter.printRecord(
186
                  student.getFirstName(),
187
                  student.getLastName(),
188
                  student.getEmail(),
189
                  student.getStudentId(),
190
                  SectionTranslationService.translateSection(
191
                      student.getSection(), sectionTranslations),
192
                  team);
193
            }
194
          }
195
        };
196
197 1 1. catmeCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::catmeCsv → KILLED
    return ResponseEntity.ok()
198
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
199
        .header(
200
            HttpHeaders.CONTENT_DISPOSITION,
201
            String.format("attachment;filename=%s_catme.csv", course.getCourseName()))
202
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
203
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
204
        .body(stream);
205
  }
206
207
  @Operation(
208
      summary = "Download compact Name to Team CSV File",
209
      description =
210
          "Returns a CSV file with the roster laid out in several side-by-side Name,Team column"
211
              + " pairs. Names are sorted by first name and abbreviated as far as possible while"
212
              + " remaining unique (first name; first name plus last initial; first name plus last"
213
              + " name). Exact duplicate names are marked with an asterisk.",
214
      responses = {
215
        @ApiResponse(
216
            responseCode = "200",
217
            description = "CSV file",
218
            content =
219
                @Content(
220
                    mediaType = "text/csv",
221
                    schema = @Schema(type = "string", format = "binary"))),
222
        @ApiResponse(responseCode = "400", description = "columns is less than 1"),
223
        @ApiResponse(responseCode = "404", description = "Course not found"),
224
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
225
      })
226
  @GetMapping(value = "/name2team", produces = "text/csv")
227
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
228
  public ResponseEntity<StreamingResponseBody> name2TeamCsv(
229
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
230
          Long courseId,
231
      @Parameter(
232
              name = "columns",
233
              description = "number of Name,Team column pairs (default 4)",
234
              example = "4")
235
          @RequestParam(defaultValue = "4")
236
          int columns)
237
      throws EntityNotFoundException {
238 1 1. name2TeamCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::name2TeamCsv → KILLED
    return teamCsvResponse(courseId, columns, "name2team", teamCsvService::writeName2TeamCsv);
239
  }
240
241
  @Operation(
242
      summary = "Download compact Team Table CSV File",
243
      description =
244
          "Returns a CSV file with the teams laid out in several side-by-side Team,Name column"
245
              + " pairs, one row per student, teams sorted by name and balanced across the columns"
246
              + " so that no team is split. Names are sorted by first name and abbreviated as far"
247
              + " as possible while remaining unique (first name; first name plus last initial;"
248
              + " first name plus last name). Exact duplicate names are marked with an asterisk."
249
              + " Students with no team are listed last with a blank team.",
250
      responses = {
251
        @ApiResponse(
252
            responseCode = "200",
253
            description = "CSV file",
254
            content =
255
                @Content(
256
                    mediaType = "text/csv",
257
                    schema = @Schema(type = "string", format = "binary"))),
258
        @ApiResponse(responseCode = "400", description = "columns is less than 1"),
259
        @ApiResponse(responseCode = "404", description = "Course not found"),
260
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
261
      })
262
  @GetMapping(value = "/teamtable", produces = "text/csv")
263
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
264
  public ResponseEntity<StreamingResponseBody> teamTableCsv(
265
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
266
          Long courseId,
267
      @Parameter(
268
              name = "columns",
269
              description = "number of Team,Name column pairs (default 4)",
270
              example = "4")
271
          @RequestParam(defaultValue = "4")
272
          int columns)
273
      throws EntityNotFoundException {
274 1 1. teamTableCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamTableCsv → KILLED
    return teamCsvResponse(courseId, columns, "teamtable", teamCsvService::writeTeamTableCsv);
275
  }
276
277
  @Operation(
278
      summary = "Download the combined output of /teamtable and /name2team",
279
      description =
280
          "Returns a CSV file with the first header being 'by name' followed by the output"
281
              + " from /name2team and the next header being 'by team' followed by the output"
282
              + " from /teamtable.",
283
      responses = {
284
        @ApiResponse(
285
            responseCode = "200",
286
            description = "CSV file",
287
            content =
288
                @Content(
289
                    mediaType = "text/csv",
290
                    schema = @Schema(type = "string", format = "binary"))),
291
        @ApiResponse(responseCode = "400", description = "columns is less than 1"),
292
        @ApiResponse(responseCode = "404", description = "Course not found"),
293
        @ApiResponse(responseCode = "500", description = "Internal Server Error")
294
      })
295
  @GetMapping(value = "/formattedteams", produces = "text/csv")
296
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
297
  public ResponseEntity<StreamingResponseBody> formattedTeamCsv(
298
      @Parameter(name = "courseId", description = "course id", example = "1") @RequestParam
299
          Long courseId)
300
      throws EntityNotFoundException {
301
    final int columns = 1;
302 1 1. formattedTeamCsv : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::formattedTeamCsv → KILLED
    return teamCsvResponse(
303
        courseId, columns, ("formatted_teams_" + courseId), teamCsvService::writeFormattedTeamsCsv);
304
  }
305
306
  /** Writes one of the compact team CSV tables from a list of abbreviated names and teams. */
307
  @FunctionalInterface
308
  interface TeamCsvWriter {
309
    void write(Writer writer, List<NameAndTeam> entries, int columns) throws IOException;
310
  }
311
312
  /**
313
   * Shared response for the compact team CSV downloads: looks up the course, validates the column
314
   * count, loads the ROSTER and MANUAL students sorted by first name, abbreviates their names and
315
   * streams the table written by the given writer.
316
   *
317
   * @param courseId the course id
318
   * @param columns the number of column pairs, at least 1
319
   * @param suffix the file name suffix, e.g. "name2team" gives "&lt;courseName&gt;_name2team.csv"
320
   * @param csvWriter writes the table
321
   * @return the streaming CSV response
322
   * @throws EntityNotFoundException if the course does not exist
323
   * @throws IllegalArgumentException if columns is less than 1
324
   */
325
  private ResponseEntity<StreamingResponseBody> teamCsvResponse(
326
      Long courseId, int columns, String suffix, TeamCsvWriter csvWriter)
327
      throws EntityNotFoundException {
328
    Course course =
329
        courseRepository
330
            .findById(courseId)
331 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));
332 2 1. teamCsvResponse : negated conditional → KILLED
2. teamCsvResponse : changed conditional boundary → KILLED
    if (columns < 1) {
333
      throw new IllegalArgumentException("columns must be at least 1");
334
    }
335
    StreamingResponseBody stream =
336
        (outputStream) -> {
337
          List<RosterStudent> rosterStudents =
338
              rosterStudentRepository
339
                  .findByCourseIdAndRosterStatusInOrderByFirstNameAscLastNameAscIgnoreCase(
340
                      courseId, List.of(RosterStatus.ROSTER, RosterStatus.MANUAL));
341
          List<NameAndTeam> entries = teamCsvService.nameAndTeams(rosterStudents);
342
          try (Writer writer = new OutputStreamWriter(outputStream, StandardCharsets.UTF_8)) {
343 1 1. lambda$teamCsvResponse$1 : removed call to edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController$TeamCsvWriter::write → KILLED
            csvWriter.write(writer, entries, columns);
344
          }
345
        };
346
347 1 1. teamCsvResponse : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::teamCsvResponse → KILLED
    return ResponseEntity.ok()
348
        .contentType(MediaType.parseMediaType("text/csv; charset=UTF-8"))
349
        .header(
350
            HttpHeaders.CONTENT_DISPOSITION,
351
            String.format("attachment;filename=%s_%s.csv", course.getCourseName(), suffix))
352
        .header(HttpHeaders.CONTENT_TYPE, "text/csv; charset=UTF-8")
353
        .header(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION)
354
        .body(stream);
355
  }
356
}

Mutations

76

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

82

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

84

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

90

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

122

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

130

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

138

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

170

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

181

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

184

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

185

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

197

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

238

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

274

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

302

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

331

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_teamtable_no_such_course()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/CSVDownloadsController::lambda$teamCsvResponse$0 → KILLED

332

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

343

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

347

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