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

Mutations

86

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

94

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

102

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

134

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

145

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

148

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

149

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

161

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

194

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

200

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_success()]
removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED

202

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_success()]
removed call to org/apache/commons/csv/CSVPrinter::printRecord → KILLED

207

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

248

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

284

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

312

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

316

1.1
Location : lambda$nameAndTeamTablesCsv$0
Killed by : edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.CSVDownloadsControllerTests]/[method:test_nameandteam_csv()]
removed call to edu/ucsb/cs156/frontiers/services/TeamCsvService::writeNameAndTeamTablesCsv → KILLED

344

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

345

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

356

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

360

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

376

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

Active mutators

Tests examined


Report generated by PIT 1.30.0 support