RosterStudentsController.java

1
package edu.ucsb.cs156.frontiers.controllers;
2
3
import com.fasterxml.jackson.core.JsonProcessingException;
4
import edu.ucsb.cs156.frontiers.entities.Course;
5
import edu.ucsb.cs156.frontiers.entities.Job;
6
import edu.ucsb.cs156.frontiers.entities.RosterStudent;
7
import edu.ucsb.cs156.frontiers.entities.User;
8
import edu.ucsb.cs156.frontiers.enums.InsertStatus;
9
import edu.ucsb.cs156.frontiers.enums.OrgStatus;
10
import edu.ucsb.cs156.frontiers.enums.RosterStatus;
11
import edu.ucsb.cs156.frontiers.errors.EntityNotFoundException;
12
import edu.ucsb.cs156.frontiers.errors.NoLinkedOrganizationException;
13
import edu.ucsb.cs156.frontiers.jobs.UpdateOrgMembershipJob;
14
import edu.ucsb.cs156.frontiers.models.RosterStudentDTO;
15
import edu.ucsb.cs156.frontiers.models.UpsertResponse;
16
import edu.ucsb.cs156.frontiers.repositories.CourseRepository;
17
import edu.ucsb.cs156.frontiers.repositories.RosterStudentRepository;
18
import edu.ucsb.cs156.frontiers.services.CurrentUserService;
19
import edu.ucsb.cs156.frontiers.services.OrganizationMemberService;
20
import edu.ucsb.cs156.frontiers.services.UpdateUserService;
21
import edu.ucsb.cs156.frontiers.services.jobs.JobService;
22
import edu.ucsb.cs156.frontiers.utilities.CanonicalFormConverter;
23
import io.swagger.v3.oas.annotations.Operation;
24
import io.swagger.v3.oas.annotations.Parameter;
25
import io.swagger.v3.oas.annotations.tags.Tag;
26
import java.security.NoSuchAlgorithmException;
27
import java.security.spec.InvalidKeySpecException;
28
import java.util.Optional;
29
import lombok.extern.slf4j.Slf4j;
30
import org.springframework.beans.factory.annotation.Autowired;
31
import org.springframework.http.HttpStatus;
32
import org.springframework.http.ResponseEntity;
33
import org.springframework.security.access.AccessDeniedException;
34
import org.springframework.security.access.prepost.PreAuthorize;
35
import org.springframework.transaction.annotation.Transactional;
36
import org.springframework.web.bind.annotation.DeleteMapping;
37
import org.springframework.web.bind.annotation.GetMapping;
38
import org.springframework.web.bind.annotation.PathVariable;
39
import org.springframework.web.bind.annotation.PostMapping;
40
import org.springframework.web.bind.annotation.PutMapping;
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.server.ResponseStatusException;
45
46
@Tag(name = "RosterStudents")
47
@RequestMapping("/api/rosterstudents")
48
@RestController
49
@Slf4j
50
public class RosterStudentsController extends ApiController {
51
52
  @Autowired private JobService jobService;
53
  @Autowired private OrganizationMemberService organizationMemberService;
54
55
  @Autowired private RosterStudentRepository rosterStudentRepository;
56
57
  @Autowired private CourseRepository courseRepository;
58
59
  @Autowired private UpdateUserService updateUserService;
60
61
  @Autowired private CurrentUserService currentUserService;
62
63
  /**
64
   * This method creates a new RosterStudent. It is important to keep the code in this method
65
   * consistent with the code for adding multiple roster students from a CSV
66
   *
67
   * @return the created RosterStudent
68
   */
69
  @Operation(summary = "Create a new roster student")
70
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
71
  @PostMapping("/post")
72
  public ResponseEntity<UpsertResponse> postRosterStudent(
73
      @Parameter(name = "studentId") @RequestParam String studentId,
74
      @Parameter(name = "firstName") @RequestParam String firstName,
75
      @Parameter(name = "lastName") @RequestParam String lastName,
76
      @Parameter(name = "email") @RequestParam String email,
77
      @Parameter(name = "courseId") @RequestParam Long courseId,
78
      @Parameter(name = "section") @RequestParam(required = false) String section)
79
      throws EntityNotFoundException {
80
81
    // Get Course or else throw an error
82
83
    Course course =
84
        courseRepository
85
            .findById(courseId)
86 1 1. lambda$postRosterStudent$0 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$postRosterStudent$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
87
88
    RosterStudent rosterStudent =
89
        RosterStudent.builder()
90
            .studentId(studentId)
91
            .firstName(firstName)
92
            .lastName(lastName)
93
            .email(email.strip())
94 1 1. postRosterStudent : negated conditional → KILLED
            .section(section != null ? section : "")
95
            .build();
96
97
    UpsertResponse upsertResponse = upsertStudent(rosterStudent, course, RosterStatus.MANUAL);
98 1 1. postRosterStudent : negated conditional → KILLED
    if (upsertResponse.getInsertStatus() == InsertStatus.REJECTED) {
99 1 1. postRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::postRosterStudent → KILLED
      return ResponseEntity.status(HttpStatus.CONFLICT).body(upsertResponse);
100
    } else {
101
      rosterStudent = rosterStudentRepository.save(upsertResponse.rosterStudent());
102 1 1. postRosterStudent : removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUserToRosterStudent → KILLED
      updateUserService.attachUserToRosterStudent(rosterStudent);
103 1 1. postRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::postRosterStudent → KILLED
      return ResponseEntity.ok(upsertResponse);
104
    }
105
  }
106
107
  /**
108
   * This method returns a list of roster students for a given course.
109
   *
110
   * @return a list of all courses.
111
   */
112
  @Operation(summary = "List all roster students for a course")
113
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
114
  @GetMapping("/course/{courseId}")
115
  public Iterable<RosterStudentDTO> rosterStudentForCourse(
116
      @Parameter(name = "courseId") @PathVariable Long courseId) throws EntityNotFoundException {
117
    courseRepository
118
        .findById(courseId)
119 1 1. lambda$rosterStudentForCourse$1 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$rosterStudentForCourse$1 → KILLED
        .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
120
    Iterable<RosterStudent> rosterStudents =
121
        rosterStudentRepository.findByCourseIdOrderByFirstNameAscLastNameAscIgnoreCase(courseId);
122
    Iterable<RosterStudentDTO> rosterStudentDTOs =
123
        () ->
124 1 1. lambda$rosterStudentForCourse$2 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$rosterStudentForCourse$2 → KILLED
            java.util.stream.StreamSupport.stream(rosterStudents.spliterator(), false)
125
                .map(RosterStudentDTO::new)
126
                .iterator();
127 1 1. rosterStudentForCourse : replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::rosterStudentForCourse → KILLED
    return rosterStudentDTOs;
128
  }
129
130
  public static UpsertResponse upsertStudent(
131
      RosterStudent student, Course course, RosterStatus rosterStatus) {
132
    String convertedEmail = CanonicalFormConverter.convertToValidEmail(student.getEmail()).strip();
133
    Optional<RosterStudent> existingStudent =
134
        course.getRosterStudents().stream()
135
            .filter(
136 2 1. lambda$upsertStudent$3 : replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$3 → KILLED
2. lambda$upsertStudent$3 : replaced boolean return with false for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$3 → KILLED
                filteringStudent -> student.getStudentId().equals(filteringStudent.getStudentId()))
137
            .findFirst();
138
    Optional<RosterStudent> existingStudentByEmail =
139
        course.getRosterStudents().stream()
140 2 1. lambda$upsertStudent$4 : replaced boolean return with false for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$4 → KILLED
2. lambda$upsertStudent$4 : replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$4 → KILLED
            .filter(filteringStudent -> convertedEmail.equals(filteringStudent.getEmail()))
141
            .findFirst();
142 2 1. upsertStudent : negated conditional → KILLED
2. upsertStudent : negated conditional → KILLED
    if (existingStudent.isPresent() && existingStudentByEmail.isPresent()) {
143 1 1. upsertStudent : negated conditional → KILLED
      if (existingStudent.get().getId().equals(existingStudentByEmail.get().getId())) {
144
        RosterStudent existingStudentObj = existingStudent.get();
145 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
        existingStudentObj.setRosterStatus(rosterStatus);
146 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED
        existingStudentObj.setFirstName(student.getFirstName());
147 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED
        existingStudentObj.setLastName(student.getLastName());
148 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
        existingStudentObj.setSection(student.getSection());
149 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
        return new UpsertResponse(InsertStatus.UPDATED, existingStudentObj);
150
      } else {
151 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
        return new UpsertResponse(InsertStatus.REJECTED, student);
152
      }
153 2 1. upsertStudent : negated conditional → KILLED
2. upsertStudent : negated conditional → KILLED
    } else if (existingStudent.isPresent() || existingStudentByEmail.isPresent()) {
154
      RosterStudent existingStudentObj =
155 1 1. upsertStudent : negated conditional → KILLED
          existingStudent.isPresent() ? existingStudent.get() : existingStudentByEmail.get();
156 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
      existingStudentObj.setRosterStatus(rosterStatus);
157 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED
      existingStudentObj.setFirstName(student.getFirstName());
158 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED
      existingStudentObj.setLastName(student.getLastName());
159 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
      existingStudentObj.setSection(student.getSection());
160 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED
      existingStudentObj.setEmail(convertedEmail);
161 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED
      existingStudentObj.setStudentId(student.getStudentId());
162 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
      return new UpsertResponse(InsertStatus.UPDATED, existingStudentObj);
163
    } else {
164 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED
      student.setCourse(course);
165 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED
      student.setEmail(convertedEmail);
166 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
      student.setRosterStatus(rosterStatus);
167
      // if an installationID exists, orgStatus should be set to JOINCOURSE. if it doesn't exist
168
      // (null), set orgStatus to PENDING.
169 1 1. upsertStudent : negated conditional → KILLED
      if (course.getInstallationId() != null) {
170 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED
        student.setOrgStatus(OrgStatus.JOINCOURSE);
171
      } else {
172 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED
        student.setOrgStatus(OrgStatus.PENDING);
173
      }
174 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
      return new UpsertResponse(InsertStatus.INSERTED, student);
175
    }
176
  }
177
178
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
179
  @PostMapping("/updateCourseMembership")
180
  public Job updateCourseMembership(
181
      @Parameter(name = "courseId", description = "Course ID") @RequestParam Long courseId)
182
      throws NoSuchAlgorithmException, InvalidKeySpecException, JsonProcessingException {
183
    Course course =
184
        courseRepository
185
            .findById(courseId)
186 1 1. lambda$updateCourseMembership$5 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$updateCourseMembership$5 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId));
187 2 1. updateCourseMembership : negated conditional → KILLED
2. updateCourseMembership : negated conditional → KILLED
    if (course.getInstallationId() == null || course.getOrgName() == null) {
188
      throw new NoLinkedOrganizationException(course.getCourseName());
189
    } else {
190
      UpdateOrgMembershipJob job =
191
          UpdateOrgMembershipJob.builder()
192
              .rosterStudentRepository(rosterStudentRepository)
193
              .organizationMemberService(organizationMemberService)
194
              .course(course)
195
              .build();
196
197 1 1. updateCourseMembership : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::updateCourseMembership → KILLED
      return jobService.runAsJob(job);
198
    }
199
  }
200
201
  @Operation(
202
      summary =
203
          "Allow roster student to join a course by generating an invitation to the linked Github Org")
204
  @PreAuthorize("hasRole('ROLE_USER')")
205
  @PutMapping("/joinCourse")
206
  public ResponseEntity<String> joinCourseOnGitHub(
207
      @Parameter(
208
              name = "rosterStudentId",
209
              description = "Roster Student joining a course on GitHub")
210
          @RequestParam
211
          Long rosterStudentId)
212
      throws NoSuchAlgorithmException, InvalidKeySpecException, JsonProcessingException {
213
214
    User currentUser = currentUserService.getUser();
215
    RosterStudent rosterStudent =
216
        rosterStudentRepository
217
            .findById(rosterStudentId)
218 1 1. lambda$joinCourseOnGitHub$6 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$joinCourseOnGitHub$6 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(RosterStudent.class, rosterStudentId));
219
220 2 1. joinCourseOnGitHub : negated conditional → KILLED
2. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getUser() == null || currentUser.getId() != rosterStudent.getUser().getId()) {
221
      throw new AccessDeniedException("User not authorized join the course as this roster student");
222
    }
223
224 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getRosterStatus() == RosterStatus.DROPPED) {
225
      throw new AccessDeniedException(
226
          "You have dropped this course. Please contact your instructor.");
227
    }
228
229 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getGithubId() != null
230 1 1. joinCourseOnGitHub : negated conditional → KILLED
        && rosterStudent.getGithubLogin() != null
231 1 1. joinCourseOnGitHub : negated conditional → KILLED
        && (rosterStudent.getOrgStatus() == OrgStatus.MEMBER
232 1 1. joinCourseOnGitHub : negated conditional → KILLED
            || rosterStudent.getOrgStatus() == OrgStatus.OWNER)) {
233 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.badRequest()
234
          .body("This user has already linked a Github account to this course.");
235
    }
236
237 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getCourse().getOrgName() == null
238 1 1. joinCourseOnGitHub : negated conditional → KILLED
        || rosterStudent.getCourse().getInstallationId() == null) {
239 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.badRequest()
240
          .body("Course has not been set up. Please ask your instructor for help.");
241
    }
242 1 1. joinCourseOnGitHub : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubId → KILLED
    rosterStudent.setGithubId(currentUser.getGithubId());
243 1 1. joinCourseOnGitHub : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubLogin → KILLED
    rosterStudent.setGithubLogin(currentUser.getGithubLogin());
244
    OrgStatus status = organizationMemberService.inviteOrganizationMember(rosterStudent);
245 1 1. joinCourseOnGitHub : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED
    rosterStudent.setOrgStatus(status);
246
    rosterStudentRepository.save(rosterStudent);
247 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (status == OrgStatus.INVITED) {
248 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.accepted().body("Successfully invited student to Organization");
249 2 1. joinCourseOnGitHub : negated conditional → KILLED
2. joinCourseOnGitHub : negated conditional → KILLED
    } else if (status == OrgStatus.MEMBER || status == OrgStatus.OWNER) {
250 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.accepted()
251
          .body("Already in organization - set status to %s".formatted(status.toString()));
252
    } else {
253 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.internalServerError().body("Could not invite student to Organization");
254
    }
255
  }
256
257
  @Operation(summary = "Get Associated Roster Students with a User")
258
  @PreAuthorize("hasRole('ROLE_USER')")
259
  @GetMapping("/associatedRosterStudents")
260
  public Iterable<RosterStudent> getAssociatedRosterStudents() {
261
    User currentUser = currentUserService.getUser();
262
    Iterable<RosterStudent> rosterStudents = rosterStudentRepository.findAllByUser((currentUser));
263 1 1. getAssociatedRosterStudents : replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::getAssociatedRosterStudents → KILLED
    return rosterStudents;
264
  }
265
266
  @Operation(summary = "Update a roster student")
267
  @PreAuthorize("@CourseSecurity.hasRosterStudentManagementPermissions(#root, #id)")
268
  @PutMapping("/update")
269
  public RosterStudent updateRosterStudent(
270
      @Parameter(name = "id") @RequestParam Long id,
271
      @Parameter(name = "firstName") @RequestParam(required = false) String firstName,
272
      @Parameter(name = "lastName") @RequestParam(required = false) String lastName,
273
      @Parameter(name = "studentId") @RequestParam(required = false) String studentId,
274
      @Parameter(name = "section") @RequestParam(required = false) String section)
275
      throws EntityNotFoundException {
276
277 3 1. updateRosterStudent : negated conditional → KILLED
2. updateRosterStudent : negated conditional → KILLED
3. updateRosterStudent : negated conditional → KILLED
    if (firstName == null
278
        || lastName == null
279
        || studentId == null
280 1 1. updateRosterStudent : negated conditional → KILLED
        || firstName.trim().isEmpty()
281 1 1. updateRosterStudent : negated conditional → KILLED
        || lastName.trim().isEmpty()
282 1 1. updateRosterStudent : negated conditional → KILLED
        || studentId.trim().isEmpty()) {
283
      throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Required fields cannot be empty");
284
    }
285
286
    RosterStudent rosterStudent =
287
        rosterStudentRepository
288
            .findById(id)
289 1 1. lambda$updateRosterStudent$7 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$updateRosterStudent$7 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(RosterStudent.class, id));
290
291 1 1. updateRosterStudent : negated conditional → KILLED
    if (!rosterStudent.getStudentId().trim().equals(studentId.trim())) {
292
      Optional<RosterStudent> existingStudent =
293
          rosterStudentRepository.findByCourseIdAndStudentId(
294
              rosterStudent.getCourse().getId(), studentId.trim());
295 1 1. updateRosterStudent : negated conditional → KILLED
      if (existingStudent.isPresent()) {
296
        throw new ResponseStatusException(
297
            HttpStatus.BAD_REQUEST, "Student ID already exists in this course");
298
      }
299
    }
300
301 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED
    rosterStudent.setFirstName(firstName.trim());
302 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED
    rosterStudent.setLastName(lastName.trim());
303 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED
    rosterStudent.setStudentId(studentId.trim());
304
305 1 1. updateRosterStudent : negated conditional → KILLED
    if (section != null) {
306 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
      rosterStudent.setSection(section.trim());
307
    }
308
309 1 1. updateRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::updateRosterStudent → KILLED
    return rosterStudentRepository.save(rosterStudent);
310
  }
311
312
  @Operation(
313
      summary = "Restore a roster student",
314
      description = "Makes a student who previously dropped the course able to join and interact")
315
  @PreAuthorize("@CourseSecurity.hasRosterStudentManagementPermissions(#root, #id)")
316
  @PutMapping("/restore")
317
  public RosterStudent restoreRosterStudent(@Parameter(name = "id") @RequestParam Long id)
318
      throws EntityNotFoundException {
319
    RosterStudent rosterStudent =
320
        rosterStudentRepository
321
            .findById(id)
322 1 1. lambda$restoreRosterStudent$8 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$restoreRosterStudent$8 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(RosterStudent.class, id));
323 1 1. restoreRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
    rosterStudent.setRosterStatus(RosterStatus.MANUAL);
324 1 1. restoreRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::restoreRosterStudent → KILLED
    return rosterStudentRepository.save(rosterStudent);
325
  }
326
327
  @Operation(summary = "Delete a roster student")
328
  @PreAuthorize("@CourseSecurity.hasRosterStudentManagementPermissions(#root, #id)")
329
  @DeleteMapping("/delete")
330
  @Transactional
331
  public ResponseEntity<String> deleteRosterStudent(
332
      @Parameter(name = "id") @RequestParam Long id,
333
      @Parameter(
334
              name = "removeFromOrg",
335
              description = "Whether to remove student from GitHub organization")
336
          @RequestParam(defaultValue = "true")
337
          boolean removeFromOrg)
338
      throws EntityNotFoundException {
339
    RosterStudent rosterStudent =
340
        rosterStudentRepository
341
            .findById(id)
342 1 1. lambda$deleteRosterStudent$9 : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$deleteRosterStudent$9 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(RosterStudent.class, id));
343
    Course course = rosterStudent.getCourse();
344
345
    boolean orgRemovalAttempted = false;
346
    boolean orgRemovalSuccessful = false;
347
    String orgRemovalErrorMessage = null;
348
349
    // Try to remove the student from the organization if they have a GitHub login
350
    // and removeFromOrg parameter is true
351 1 1. deleteRosterStudent : negated conditional → KILLED
    if (removeFromOrg
352 1 1. deleteRosterStudent : negated conditional → KILLED
        && rosterStudent.getGithubLogin() != null
353 1 1. deleteRosterStudent : negated conditional → KILLED
        && course.getOrgName() != null
354 1 1. deleteRosterStudent : negated conditional → KILLED
        && course.getInstallationId() != null) {
355
      orgRemovalAttempted = true;
356
      try {
357 1 1. deleteRosterStudent : removed call to edu/ucsb/cs156/frontiers/services/OrganizationMemberService::removeOrganizationMember → KILLED
        organizationMemberService.removeOrganizationMember(rosterStudent);
358
        orgRemovalSuccessful = true;
359
      } catch (Exception e) {
360
        log.error("Error removing student from organization: {}", e.getMessage());
361
        orgRemovalErrorMessage = e.getMessage();
362
        // Continue with deletion even if organization removal fails
363
      }
364
    }
365
366 1 1. deleteRosterStudent : negated conditional → KILLED
    if (!rosterStudent.getTeamMembers().isEmpty()) {
367
      rosterStudent
368
          .getTeamMembers()
369 1 1. deleteRosterStudent : removed call to java/util/List::forEach → KILLED
          .forEach(
370
              teamMember -> {
371
                teamMember.getTeam().getTeamMembers().remove(teamMember);
372 1 1. lambda$deleteRosterStudent$10 : removed call to edu/ucsb/cs156/frontiers/entities/TeamMember::setTeam → KILLED
                teamMember.setTeam(null);
373
              });
374
    }
375
376
    rosterStudent.getCourse().getRosterStudents().remove(rosterStudent);
377 1 1. deleteRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED
    rosterStudent.setCourse(null);
378 1 1. deleteRosterStudent : removed call to edu/ucsb/cs156/frontiers/repositories/RosterStudentRepository::delete → KILLED
    rosterStudentRepository.delete(rosterStudent);
379
380 1 1. deleteRosterStudent : negated conditional → KILLED
    if (!orgRemovalAttempted) {
381 1 1. deleteRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED
      return ResponseEntity.ok(
382
          "Successfully deleted roster student and removed him/her from the course list");
383 1 1. deleteRosterStudent : negated conditional → KILLED
    } else if (orgRemovalSuccessful) {
384 1 1. deleteRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED
      return ResponseEntity.ok(
385
          "Successfully deleted roster student and removed him/her from the course list and organization");
386
    } else {
387 1 1. deleteRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED
      return ResponseEntity.ok(
388
          "Successfully deleted roster student but there was an error removing them from the course organization: "
389
              + orgRemovalErrorMessage);
390
    }
391
  }
392
}

Mutations

86

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

94

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

98

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

99

1.1
Location : postRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_post_fails_on_matching()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::postRosterStudent → KILLED

102

1.1
Location : postRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudent_emailSanitized()]
removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUserToRosterStudent → KILLED

103

1.1
Location : postRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudentWithNoInstallationId()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::postRosterStudent → KILLED

119

1.1
Location : lambda$rosterStudentForCourse$1
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:getting_roster_students_for_a_non_existing_course_returns_appropriate_error()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$rosterStudentForCourse$1 → KILLED

124

1.1
Location : lambda$rosterStudentForCourse$2
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testRosterStudentsByCourse()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$rosterStudentForCourse$2 → KILLED

127

1.1
Location : rosterStudentForCourse
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testRosterStudentsByCourse()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::rosterStudentForCourse → KILLED

136

1.1
Location : lambda$upsertStudent$3
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 boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$3 → KILLED

2.2
Location : lambda$upsertStudent$3
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_post_fails_on_matching()]
replaced boolean return with false for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$3 → KILLED

140

1.1
Location : lambda$upsertStudent$4
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_post_fails_on_matching()]
replaced boolean return with false for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$4 → KILLED

2.2
Location : lambda$upsertStudent$4
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_post_fails_on_matching()]
replaced boolean return with true for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$upsertStudent$4 → KILLED

142

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

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

143

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

145

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

146

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED

147

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED

148

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED

149

1.1
Location : upsertStudent
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/RosterStudentsController::upsertStudent → KILLED

151

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_post_fails_on_matching()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED

153

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

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

155

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

156

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudentUpdatingTheEmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED

157

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudentUpdatingTheEmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED

158

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudentUpdatingTheEmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED

159

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED

160

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudentUpdatingTheEmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED

161

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsCSVControllerTests]/[method:updates_in_upsert_correctly()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED

162

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudentUpdatingTheEmail()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED

164

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudent_emailSanitized()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED

165

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudent_withUmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED

166

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudent_emailSanitized()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED

169

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

170

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudentWithInstallationId()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED

172

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudentWithNoInstallationId()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED

174

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testPostRosterStudent_withSection()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED

186

1.1
Location : lambda$updateCourseMembership$5
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:notFound()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$updateCourseMembership$5 → KILLED

187

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

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

197

1.1
Location : updateCourseMembership
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:job_actually_fires()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::updateCourseMembership → KILLED

218

1.1
Location : lambda$joinCourseOnGitHub$6
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testLinkGitHub_notFound()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$joinCourseOnGitHub$6 → KILLED

220

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

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

224

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

229

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

230

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

231

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

232

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

233

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testJoinCourseOnGitHub_alreadyJoined_Owner()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED

237

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

238

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

239

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:no_fire_on_no_installation_id()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED

242

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_already_part_is_member()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubId → KILLED

243

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:cant_invite()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubLogin → KILLED

245

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_already_part_is_member()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED

247

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

248

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_fires_invite()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED

249

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

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

250

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:test_already_part_is_member()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED

253

1.1
Location : joinCourseOnGitHub
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:cant_invite()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED

263

1.1
Location : getAssociatedRosterStudents
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testGetAssociatedRosterStudents()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::getAssociatedRosterStudents → KILLED

277

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

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

3.3
Location : updateRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_nullLastName()]
negated conditional → KILLED

280

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

281

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

282

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

289

1.1
Location : lambda$updateRosterStudent$7
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_notFound()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$updateRosterStudent$7 → KILLED

291

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

295

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

301

1.1
Location : updateRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_success()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED

302

1.1
Location : updateRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_success()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED

303

1.1
Location : updateRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_newStudentIdNotExists()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED

305

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

306

1.1
Location : updateRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_updatesSectionWhenProvided()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED

309

1.1
Location : updateRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpdateRosterStudent_success()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::updateRosterStudent → KILLED

322

1.1
Location : lambda$restoreRosterStudent$8
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testRestoreRosterStudent_notFound()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$restoreRosterStudent$8 → KILLED

323

1.1
Location : restoreRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testRestoreRosterStudent_success()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED

324

1.1
Location : restoreRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testRestoreRosterStudent_success()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::restoreRosterStudent → KILLED

342

1.1
Location : lambda$deleteRosterStudent$9
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_notFound()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::lambda$deleteRosterStudent$9 → KILLED

351

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

352

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

353

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

354

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

357

1.1
Location : deleteRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_withGithubLogin_orgRemovalFails()]
removed call to edu/ucsb/cs156/frontiers/services/OrganizationMemberService::removeOrganizationMember → KILLED

366

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

369

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

372

1.1
Location : lambda$deleteRosterStudent$10
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_withGithubLogin_success()]
removed call to edu/ucsb/cs156/frontiers/entities/TeamMember::setTeam → KILLED

377

1.1
Location : deleteRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_withRemoveFromOrgFalse_noGithubLogin_success()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED

378

1.1
Location : deleteRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_success()]
removed call to edu/ucsb/cs156/frontiers/repositories/RosterStudentRepository::delete → KILLED

380

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

381

1.1
Location : deleteRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_success()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED

383

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

384

1.1
Location : deleteRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_withRemoveFromOrgTrue_success()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED

387

1.1
Location : deleteRosterStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testDeleteRosterStudent_withGithubLogin_orgRemovalFails()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0