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
            .build();
95
96 1 1. postRosterStudent : negated conditional → KILLED
    if (section != null) {
97 1 1. postRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
      rosterStudent.setSection(section);
98
    }
99
100
    UpsertResponse upsertResponse = upsertStudent(rosterStudent, course, RosterStatus.MANUAL);
101 1 1. postRosterStudent : negated conditional → KILLED
    if (upsertResponse.getInsertStatus() == InsertStatus.REJECTED) {
102 1 1. postRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::postRosterStudent → KILLED
      return ResponseEntity.status(HttpStatus.CONFLICT).body(upsertResponse);
103
    } else {
104
      rosterStudent = rosterStudentRepository.save(upsertResponse.rosterStudent());
105 1 1. postRosterStudent : removed call to edu/ucsb/cs156/frontiers/services/UpdateUserService::attachUserToRosterStudent → KILLED
      updateUserService.attachUserToRosterStudent(rosterStudent);
106 1 1. postRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::postRosterStudent → KILLED
      return ResponseEntity.ok(upsertResponse);
107
    }
108
  }
109
110
  /**
111
   * This method returns a list of roster students for a given course.
112
   *
113
   * @return a list of all courses.
114
   */
115
  @Operation(summary = "List all roster students for a course")
116
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
117
  @GetMapping("/course/{courseId}")
118
  public Iterable<RosterStudentDTO> rosterStudentForCourse(
119
      @Parameter(name = "courseId") @PathVariable Long courseId) throws EntityNotFoundException {
120
    courseRepository
121
        .findById(courseId)
122 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));
123
    Iterable<RosterStudent> rosterStudents = rosterStudentRepository.findByCourseId(courseId);
124
    Iterable<RosterStudentDTO> rosterStudentDTOs =
125
        () ->
126 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)
127
                .sorted(
128
                    java.util.Comparator.comparing(RosterStudent::getLastName)
129
                        .thenComparing(RosterStudent::getFirstName))
130
                .map(RosterStudentDTO::new)
131
                .iterator();
132 1 1. rosterStudentForCourse : replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::rosterStudentForCourse → KILLED
    return rosterStudentDTOs;
133
  }
134
135
  public static UpsertResponse upsertStudent(
136
      RosterStudent student, Course course, RosterStatus rosterStatus) {
137
    String convertedEmail = CanonicalFormConverter.convertToValidEmail(student.getEmail().strip());
138
    Optional<RosterStudent> existingStudent =
139
        course.getRosterStudents().stream()
140
            .filter(
141 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()))
142
            .findFirst();
143
    Optional<RosterStudent> existingStudentByEmail =
144
        course.getRosterStudents().stream()
145 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()))
146
            .findFirst();
147 2 1. upsertStudent : negated conditional → KILLED
2. upsertStudent : negated conditional → KILLED
    if (existingStudent.isPresent() && existingStudentByEmail.isPresent()) {
148 1 1. upsertStudent : negated conditional → KILLED
      if (existingStudent.get().getId().equals(existingStudentByEmail.get().getId())) {
149
        RosterStudent existingStudentObj = existingStudent.get();
150 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
        existingStudentObj.setRosterStatus(rosterStatus);
151 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED
        existingStudentObj.setFirstName(student.getFirstName());
152 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED
        existingStudentObj.setLastName(student.getLastName());
153 1 1. upsertStudent : negated conditional → KILLED
        if (student.getSection() != null) {
154 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
          existingStudentObj.setSection(student.getSection());
155
        }
156 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
        return new UpsertResponse(InsertStatus.UPDATED, existingStudentObj);
157
      } else {
158 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
        return new UpsertResponse(InsertStatus.REJECTED, student);
159
      }
160 2 1. upsertStudent : negated conditional → KILLED
2. upsertStudent : negated conditional → KILLED
    } else if (existingStudent.isPresent() || existingStudentByEmail.isPresent()) {
161
      RosterStudent existingStudentObj =
162 1 1. upsertStudent : negated conditional → KILLED
          existingStudent.isPresent() ? existingStudent.get() : existingStudentByEmail.get();
163 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
      existingStudentObj.setRosterStatus(rosterStatus);
164 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED
      existingStudentObj.setFirstName(student.getFirstName());
165 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED
      existingStudentObj.setLastName(student.getLastName());
166 1 1. upsertStudent : negated conditional → KILLED
      if (student.getSection() != null) {
167 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
        existingStudentObj.setSection(student.getSection());
168
      }
169 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED
      existingStudentObj.setEmail(convertedEmail.strip());
170 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED
      existingStudentObj.setStudentId(student.getStudentId());
171 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
      return new UpsertResponse(InsertStatus.UPDATED, existingStudentObj);
172
    } else {
173 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED
      student.setCourse(course);
174 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED
      student.setEmail(convertedEmail.strip());
175 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
      student.setRosterStatus(rosterStatus);
176
      // if an installationID exists, orgStatus should be set to JOINCOURSE. if it
177
      // doesn't exist
178
      // (null), set orgStatus to PENDING.
179 1 1. upsertStudent : negated conditional → KILLED
      if (course.getInstallationId() != null) {
180 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED
        student.setOrgStatus(OrgStatus.JOINCOURSE);
181
      } else {
182 1 1. upsertStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED
        student.setOrgStatus(OrgStatus.PENDING);
183
      }
184 1 1. upsertStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → KILLED
      return new UpsertResponse(InsertStatus.INSERTED, student);
185
    }
186
  }
187
188
  @PreAuthorize("@CourseSecurity.hasManagePermissions(#root, #courseId)")
189
  @PostMapping("/updateCourseMembership")
190
  public Job updateCourseMembership(
191
      @Parameter(name = "courseId", description = "Course ID") @RequestParam Long courseId)
192
      throws NoSuchAlgorithmException, InvalidKeySpecException, JsonProcessingException {
193
    Course course =
194
        courseRepository
195
            .findById(courseId)
196 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));
197 2 1. updateCourseMembership : negated conditional → KILLED
2. updateCourseMembership : negated conditional → KILLED
    if (course.getInstallationId() == null || course.getOrgName() == null) {
198
      throw new NoLinkedOrganizationException(course.getCourseName());
199
    } else {
200
      UpdateOrgMembershipJob job =
201
          UpdateOrgMembershipJob.builder()
202
              .rosterStudentRepository(rosterStudentRepository)
203
              .organizationMemberService(organizationMemberService)
204
              .course(course)
205
              .build();
206
207 1 1. updateCourseMembership : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::updateCourseMembership → KILLED
      return jobService.runAsJob(job);
208
    }
209
  }
210
211
  @Operation(
212
      summary =
213
          "Allow roster student to join a course by generating an invitation to the linked Github Org")
214
  @PreAuthorize("hasRole('ROLE_USER')")
215
  @PutMapping("/joinCourse")
216
  public ResponseEntity<String> joinCourseOnGitHub(
217
      @Parameter(
218
              name = "rosterStudentId",
219
              description = "Roster Student joining a course on GitHub")
220
          @RequestParam
221
          Long rosterStudentId)
222
      throws NoSuchAlgorithmException, InvalidKeySpecException, JsonProcessingException {
223
224
    User currentUser = currentUserService.getUser();
225
    RosterStudent rosterStudent =
226
        rosterStudentRepository
227
            .findById(rosterStudentId)
228 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));
229
230 2 1. joinCourseOnGitHub : negated conditional → KILLED
2. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getUser() == null || currentUser.getId() != rosterStudent.getUser().getId()) {
231
      throw new AccessDeniedException("User not authorized join the course as this roster student");
232
    }
233
234 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getRosterStatus() == RosterStatus.DROPPED) {
235
      throw new AccessDeniedException(
236
          "You have dropped this course. Please contact your instructor.");
237
    }
238
239 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getGithubId() != null
240 1 1. joinCourseOnGitHub : negated conditional → KILLED
        && rosterStudent.getGithubLogin() != null
241 1 1. joinCourseOnGitHub : negated conditional → KILLED
        && (rosterStudent.getOrgStatus() == OrgStatus.MEMBER
242 1 1. joinCourseOnGitHub : negated conditional → KILLED
            || rosterStudent.getOrgStatus() == OrgStatus.OWNER)) {
243 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.badRequest()
244
          .body("This user has already linked a Github account to this course.");
245
    }
246
247 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (rosterStudent.getCourse().getOrgName() == null
248 1 1. joinCourseOnGitHub : negated conditional → KILLED
        || rosterStudent.getCourse().getInstallationId() == null) {
249 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.badRequest()
250
          .body("Course has not been set up. Please ask your instructor for help.");
251
    }
252 1 1. joinCourseOnGitHub : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubId → KILLED
    rosterStudent.setGithubId(currentUser.getGithubId());
253 1 1. joinCourseOnGitHub : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubLogin → KILLED
    rosterStudent.setGithubLogin(currentUser.getGithubLogin());
254
    OrgStatus status = organizationMemberService.inviteOrganizationMember(rosterStudent);
255 1 1. joinCourseOnGitHub : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED
    rosterStudent.setOrgStatus(status);
256
    rosterStudentRepository.save(rosterStudent);
257 1 1. joinCourseOnGitHub : negated conditional → KILLED
    if (status == OrgStatus.INVITED) {
258 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");
259 2 1. joinCourseOnGitHub : negated conditional → KILLED
2. joinCourseOnGitHub : negated conditional → KILLED
    } else if (status == OrgStatus.MEMBER || status == OrgStatus.OWNER) {
260 1 1. joinCourseOnGitHub : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::joinCourseOnGitHub → KILLED
      return ResponseEntity.accepted()
261
          .body("Already in organization - set status to %s".formatted(status.toString()));
262
    } else {
263 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");
264
    }
265
  }
266
267
  @Operation(summary = "Get Associated Roster Students with a User")
268
  @PreAuthorize("hasRole('ROLE_USER')")
269
  @GetMapping("/associatedRosterStudents")
270
  public Iterable<RosterStudent> getAssociatedRosterStudents() {
271
    User currentUser = currentUserService.getUser();
272
    Iterable<RosterStudent> rosterStudents = rosterStudentRepository.findAllByUser((currentUser));
273 1 1. getAssociatedRosterStudents : replaced return value with Collections.emptyList for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::getAssociatedRosterStudents → KILLED
    return rosterStudents;
274
  }
275
276
  @Operation(summary = "Update a roster student")
277
  @PreAuthorize("@CourseSecurity.hasRosterStudentManagementPermissions(#root, #id)")
278
  @PutMapping("/update")
279
  public RosterStudent updateRosterStudent(
280
      @Parameter(name = "id") @RequestParam Long id,
281
      @Parameter(name = "firstName") @RequestParam(required = false) String firstName,
282
      @Parameter(name = "lastName") @RequestParam(required = false) String lastName,
283
      @Parameter(name = "studentId") @RequestParam(required = false) String studentId,
284
      @Parameter(name = "section") @RequestParam(required = false) String section)
285
      throws EntityNotFoundException {
286
287 3 1. updateRosterStudent : negated conditional → KILLED
2. updateRosterStudent : negated conditional → KILLED
3. updateRosterStudent : negated conditional → KILLED
    if (firstName == null
288
        || lastName == null
289
        || studentId == null
290 1 1. updateRosterStudent : negated conditional → KILLED
        || firstName.trim().isEmpty()
291 1 1. updateRosterStudent : negated conditional → KILLED
        || lastName.trim().isEmpty()
292 1 1. updateRosterStudent : negated conditional → KILLED
        || studentId.trim().isEmpty()) {
293
      throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "Required fields cannot be empty");
294
    }
295
296
    RosterStudent rosterStudent =
297
        rosterStudentRepository
298
            .findById(id)
299 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));
300
301 1 1. updateRosterStudent : negated conditional → KILLED
    if (!rosterStudent.getStudentId().trim().equals(studentId.trim())) {
302
      Optional<RosterStudent> existingStudent =
303
          rosterStudentRepository.findByCourseIdAndStudentId(
304
              rosterStudent.getCourse().getId(), studentId.trim());
305 1 1. updateRosterStudent : negated conditional → KILLED
      if (existingStudent.isPresent()) {
306
        throw new ResponseStatusException(
307
            HttpStatus.BAD_REQUEST, "Student ID already exists in this course");
308
      }
309
    }
310
311 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setFirstName → KILLED
    rosterStudent.setFirstName(firstName.trim());
312 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setLastName → KILLED
    rosterStudent.setLastName(lastName.trim());
313 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED
    rosterStudent.setStudentId(studentId.trim());
314
315 1 1. updateRosterStudent : negated conditional → KILLED
    if (section != null) {
316 1 1. updateRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED
      rosterStudent.setSection(section);
317
    }
318
319 1 1. updateRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::updateRosterStudent → KILLED
    return rosterStudentRepository.save(rosterStudent);
320
  }
321
322
  @Operation(
323
      summary = "Restore a roster student",
324
      description = "Makes a student who previously dropped the course able to join and interact")
325
  @PreAuthorize("@CourseSecurity.hasRosterStudentManagementPermissions(#root, #id)")
326
  @PutMapping("/restore")
327
  public RosterStudent restoreRosterStudent(@Parameter(name = "id") @RequestParam Long id)
328
      throws EntityNotFoundException {
329
    RosterStudent rosterStudent =
330
        rosterStudentRepository
331
            .findById(id)
332 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));
333 1 1. restoreRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setRosterStatus → KILLED
    rosterStudent.setRosterStatus(RosterStatus.MANUAL);
334 1 1. restoreRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::restoreRosterStudent → KILLED
    return rosterStudentRepository.save(rosterStudent);
335
  }
336
337
  @Operation(summary = "Delete a roster student")
338
  @PreAuthorize("@CourseSecurity.hasRosterStudentManagementPermissions(#root, #id)")
339
  @DeleteMapping("/delete")
340
  @Transactional
341
  public ResponseEntity<String> deleteRosterStudent(
342
      @Parameter(name = "id") @RequestParam Long id,
343
      @Parameter(
344
              name = "removeFromOrg",
345
              description = "Whether to remove student from GitHub organization")
346
          @RequestParam(defaultValue = "true")
347
          boolean removeFromOrg)
348
      throws EntityNotFoundException {
349
    RosterStudent rosterStudent =
350
        rosterStudentRepository
351
            .findById(id)
352 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));
353
    Course course = rosterStudent.getCourse();
354
355
    boolean orgRemovalAttempted = false;
356
    boolean orgRemovalSuccessful = false;
357
    String orgRemovalErrorMessage = null;
358
359
    // Try to remove the student from the organization if they have a GitHub login
360
    // and removeFromOrg parameter is true
361 1 1. deleteRosterStudent : negated conditional → KILLED
    if (removeFromOrg
362 1 1. deleteRosterStudent : negated conditional → KILLED
        && rosterStudent.getGithubLogin() != null
363 1 1. deleteRosterStudent : negated conditional → KILLED
        && course.getOrgName() != null
364 1 1. deleteRosterStudent : negated conditional → KILLED
        && course.getInstallationId() != null) {
365
      orgRemovalAttempted = true;
366
      try {
367 1 1. deleteRosterStudent : removed call to edu/ucsb/cs156/frontiers/services/OrganizationMemberService::removeOrganizationMember → KILLED
        organizationMemberService.removeOrganizationMember(rosterStudent);
368
        orgRemovalSuccessful = true;
369
      } catch (Exception e) {
370
        log.error("Error removing student from organization: {}", e.getMessage());
371
        orgRemovalErrorMessage = e.getMessage();
372
        // Continue with deletion even if organization removal fails
373
      }
374
    }
375
376 1 1. deleteRosterStudent : negated conditional → KILLED
    if (!rosterStudent.getTeamMembers().isEmpty()) {
377
      rosterStudent
378
          .getTeamMembers()
379 1 1. deleteRosterStudent : removed call to java/util/List::forEach → KILLED
          .forEach(
380
              teamMember -> {
381
                teamMember.getTeam().getTeamMembers().remove(teamMember);
382 1 1. lambda$deleteRosterStudent$10 : removed call to edu/ucsb/cs156/frontiers/entities/TeamMember::setTeam → KILLED
                teamMember.setTeam(null);
383
              });
384
    }
385
386
    rosterStudent.getCourse().getRosterStudents().remove(rosterStudent);
387 1 1. deleteRosterStudent : removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED
    rosterStudent.setCourse(null);
388 1 1. deleteRosterStudent : removed call to edu/ucsb/cs156/frontiers/repositories/RosterStudentRepository::delete → KILLED
    rosterStudentRepository.delete(rosterStudent);
389
390 1 1. deleteRosterStudent : negated conditional → KILLED
    if (!orgRemovalAttempted) {
391 1 1. deleteRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED
      return ResponseEntity.ok(
392
          "Successfully deleted roster student and removed him/her from the course list");
393 1 1. deleteRosterStudent : negated conditional → KILLED
    } else if (orgRemovalSuccessful) {
394 1 1. deleteRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED
      return ResponseEntity.ok(
395
          "Successfully deleted roster student and removed him/her from the course list and organization");
396
    } else {
397 1 1. deleteRosterStudent : replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::deleteRosterStudent → KILLED
      return ResponseEntity.ok(
398
          "Successfully deleted roster student but there was an error removing them from the course organization: "
399
              + orgRemovalErrorMessage);
400
    }
401
  }
402
}

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

96

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

97

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()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → KILLED

101

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

102

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

105

1.1
Location : postRosterStudent
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/services/UpdateUserService::attachUserToRosterStudent → KILLED

106

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

122

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

126

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

132

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

141

1.1
Location : lambda$upsertStudent$3
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudent_updatesSection_whenOnlyEmailMatches()]
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

145

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:testUpsertStudent_updatesSection_whenOnlyEmailMatches()]
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

147

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudent_doesNotChangeSection_whenOnlyEmailMatches_andSectionNull()]
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

148

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

150

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

151

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

152

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

153

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

154

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudent_updatesSection_whenIdAndEmailMatch()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → 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:testUpsertStudent_updatesSection_whenIdAndEmailMatch()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → 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:test_post_fails_on_matching()]
replaced return value with null for edu/ucsb/cs156/frontiers/controllers/RosterStudentsController::upsertStudent → 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:testUpsertStudent_updatesSection_whenOnlyEmailMatches()]
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:testPostRosterStudentWithInstallationId()]
negated conditional → 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:testUpsertStudent_updatesSection_whenOnlyEmailMatches()]
negated conditional → KILLED

163

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

164

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

165

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

166

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

167

1.1
Location : upsertStudent
Killed by : edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.frontiers.controllers.RosterStudentsControllerTests]/[method:testUpsertStudent_updatesSection_whenOnlyEmailMatches()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setSection → 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:testUpsertStudentUpdatingTheEmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → 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:testUpsertStudent_updatesSection_whenOnlyEmailMatches()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setStudentId → KILLED

171

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

173

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::setCourse → 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_withUmail()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setEmail → KILLED

175

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::setRosterStatus → KILLED

179

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

180

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

182

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

184

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

196

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

197

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

207

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

228

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

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_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

234

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

239

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

240

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

241

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

242

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

243

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

247

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

248

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

249

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

252

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()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubId → 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:test_fires_invite()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setGithubLogin → KILLED

255

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()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setOrgStatus → KILLED

257

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()]
negated conditional → KILLED

258

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

259

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()]
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:test_already_part_is_owner()]
negated conditional → KILLED

260

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

263

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

273

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

287

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

290

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

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_emptyLastName()]
negated conditional → KILLED

292

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

299

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

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_duplicateStudentId()]
negated conditional → 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_duplicateStudentId()]
negated conditional → KILLED

311

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

312

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

313

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

315

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

316

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

319

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

332

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

333

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

334

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

352

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

361

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

362

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

363

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

364

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

367

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

376

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

379

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

382

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

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_withRemoveFromOrgFalse_noGithubLogin_success()]
removed call to edu/ucsb/cs156/frontiers/entities/RosterStudent::setCourse → KILLED

388

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()]
removed call to edu/ucsb/cs156/frontiers/repositories/RosterStudentRepository::delete → KILLED

390

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

391

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

393

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

394

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

397

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