CoursesController.java

1
package edu.ucsb.cs156.organic.controllers;
2
3
import edu.ucsb.cs156.organic.entities.Course;
4
import edu.ucsb.cs156.organic.entities.Staff;
5
import edu.ucsb.cs156.organic.entities.User;
6
import edu.ucsb.cs156.organic.repositories.CourseRepository;
7
import edu.ucsb.cs156.organic.repositories.StaffRepository;
8
import edu.ucsb.cs156.organic.repositories.UserRepository;
9
import io.swagger.v3.oas.annotations.Operation;
10
import io.swagger.v3.oas.annotations.Parameter;
11
import io.swagger.v3.oas.annotations.tags.Tag;
12
import lombok.extern.slf4j.Slf4j;
13
14
import com.fasterxml.jackson.core.JsonProcessingException;
15
16
import org.springframework.beans.factory.annotation.Autowired;
17
import org.springframework.format.annotation.DateTimeFormat;
18
import org.springframework.security.access.prepost.PreAuthorize;
19
import org.springframework.web.bind.annotation.DeleteMapping;
20
import org.springframework.web.bind.annotation.GetMapping;
21
import org.springframework.web.bind.annotation.DeleteMapping;
22
import org.springframework.web.bind.annotation.PostMapping;
23
import org.springframework.web.bind.annotation.PutMapping;
24
import org.springframework.web.bind.annotation.RequestMapping;
25
import org.springframework.web.bind.annotation.RequestParam;
26
import org.springframework.web.bind.annotation.RestController;
27
28
import edu.ucsb.cs156.organic.errors.EntityNotFoundException;
29
import org.springframework.security.access.AccessDeniedException;
30
31
import java.time.LocalDateTime;
32
33
import javax.transaction.Transactional;
34
import javax.validation.Valid;
35
36
import java.util.Optional;
37
38
@Tag(name = "Courses")
39
@RequestMapping("/api/course")
40
@RestController
41
@Slf4j
42
public class CoursesController extends ApiController {
43
44
    @Autowired
45
    CourseRepository courseRepository;
46
47
    @Autowired
48
    StaffRepository courseStaffRepository;
49
50
    @Autowired
51
    UserRepository userRepository;
52
53
    @Operation(summary = "List all courses")
54
    @PreAuthorize("hasAnyRole('ROLE_USER', 'ROLE_ADMIN')")
55
    @GetMapping("/getAll")
56
    public Iterable<Course> allCourses() {
57
        User u = getCurrentUser().getUser();
58
        log.info("u={}", u);
59 1 1. allCourses : negated conditional → KILLED
        if (u.isAdmin()) {
60 1 1. allCourses : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::allCourses → KILLED
            return courseRepository.findAll();
61
        } else {
62 1 1. allCourses : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::allCourses → KILLED
            return courseRepository.findCoursesStaffedByUser(u.getGithubId());
63
        }
64
    }
65
66
    @Operation(summary= "Get a single course by id")
67
    @PreAuthorize("hasAnyRole('ROLE_USER', 'ROLE_ADMIN')")
68
    @GetMapping("/get")
69
    public Course getById(
70
            @Parameter(name="id") @RequestParam Long id) {
71
        User u = getCurrentUser().getUser();
72
73
        Course course = courseRepository.findById(id)
74 1 1. lambda$getById$0 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$getById$0 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(Course.class, id));
75
        
76 1 1. getById : negated conditional → KILLED
        if(!u.isAdmin()){
77
                courseStaffRepository.findByCourseIdAndGithubId(id, u.getGithubId())
78 1 1. lambda$getById$1 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$getById$1 → KILLED
                        .orElseThrow(() -> new AccessDeniedException(
79
                String.format("User %s is not authorized to get course %d", u.getGithubLogin(), id)));
80
        }
81
82 1 1. getById : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::getById → KILLED
        return course;
83
}
84
85
    @Operation(summary = "Create a new course")
86
    @PreAuthorize("hasRole('ROLE_ADMIN')")
87
    @PostMapping("/create")
88
    public Course postCourse(
89
            @Parameter(name = "name", description = "course name, e.g. CMPSC 156") @RequestParam String name,
90
            @Parameter(name = "school", description = "school abbreviation e.g. UCSB") @RequestParam String school,
91
            @Parameter(name = "term", description = "quarter or semester, e.g. F23") @RequestParam String term,
92
            @Parameter(name = "startDate", description = "in iso format, i.e. YYYY-mm-ddTHH:MM:SS; e.g. 2023-10-01T00:00:00 see https://en.wikipedia.org/wiki/ISO_8601") @RequestParam("startDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
93
            @Parameter(name = "endDate", description = "in iso format, i.e. YYYY-mm-ddTHH:MM:SS; e.g. 2023-12-31T11:59:59 see https://en.wikipedia.org/wiki/ISO_8601") @RequestParam("endDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate,
94
            @Parameter(name = "githubOrg", description = "for example ucsb-cs156-f23") @RequestParam String githubOrg)
95
            throws JsonProcessingException {
96
97
98
            // Check if endDate is after startDate
99 1 1. postCourse : negated conditional → KILLED
        if (endDate.isBefore(startDate)) {
100
                throw new IllegalArgumentException("End date must be after start date.");
101
        }
102
103
        Course course = Course.builder()
104
                .name(name)
105
                .school(school)
106
                .term(term)
107
                .startDate(startDate)
108
                .endDate(endDate)
109
                .githubOrg(githubOrg)
110
                .build();
111
112
        Course savedCourse = courseRepository.save(course);
113
        User u = getCurrentUser().getUser();
114
115
        Staff courseStaff = Staff.builder()
116
                .courseId(savedCourse.getId())
117
                .githubId(u.getGithubId())
118
                .build();
119
120
        log.info("courseStaff={}", courseStaff);
121
        courseStaffRepository.save(courseStaff);
122
123 1 1. postCourse : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::postCourse → KILLED
        return savedCourse;
124
    }
125
126
    @Operation(summary = "Add a staff member to a course")
127
    @PreAuthorize("hasRole('ROLE_ADMIN')")
128
    @PostMapping("/staff/create")
129
    public Staff addStaff(
130
            @Parameter(name = "courseId") @RequestParam Long courseId,
131
            @Parameter(name = "githubLogin") @RequestParam String githubLogin)
132
            throws JsonProcessingException {
133
134
        Course course = courseRepository.findById(courseId)
135 1 1. lambda$addStaff$2 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$addStaff$2 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId.toString()));
136
137
        User user = userRepository.findByGithubLogin(githubLogin)
138 1 1. lambda$addStaff$3 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$addStaff$3 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(User.class, githubLogin.toString()));
139
140
        Staff courseStaff = Staff.builder()
141
                .courseId(course.getId())
142
                .githubId(user.getGithubId())
143
                .user(user)
144
                .build();
145
146
        courseStaff = courseStaffRepository.save(courseStaff);
147
        log.info("courseStaff={}", courseStaff);
148
149 1 1. addStaff : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::addStaff → KILLED
        return courseStaff;
150
    }
151
152
    @Operation(summary = "Get Staffs for the course")
153
    @PreAuthorize("hasRole('ROLE_ADMIN')")
154
    @GetMapping("/staff/all")
155
    public Iterable<Staff> getStaff(
156
            @Parameter(name = "courseId") @RequestParam Long courseId)
157
            throws JsonProcessingException {
158
159
        Course course = courseRepository.findById(courseId)
160 1 1. lambda$getStaff$4 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$getStaff$4 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(Course.class, courseId.toString()));
161
162
        Iterable<Staff> courseStaff = courseStaffRepository.findByCourseId(course.getId());
163 1 1. getStaff : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::getStaff → KILLED
        return courseStaff;
164
    }
165
166
    @Operation(summary = "Delete a Course Staff by id")
167
    @PreAuthorize("hasRole('ROLE_ADMIN')")
168
    @DeleteMapping("/staff")
169
    public Object deleteStaff(
170
        @Parameter(name = "id") @RequestParam Long id) {
171
        Staff staff = courseStaffRepository.findById(id)
172 1 1. lambda$deleteStaff$5 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$deleteStaff$5 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(Staff.class, id.toString()));
173
174 1 1. deleteStaff : removed call to edu/ucsb/cs156/organic/repositories/StaffRepository::delete → KILLED
                courseStaffRepository.delete(staff);
175 1 1. deleteStaff : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::deleteStaff → KILLED
                return genericMessage("Staff with id %s is deleted".formatted(id));
176
        }
177
178
    @Operation(summary = "Update information for a course")
179
    // allow for roles of ADMIN or INSTRUCTOR but only if the user is a staff member
180
    // for the course
181
    @PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_INSTRUCTOR')")
182
    @PutMapping("/update")
183
    public Course updateCourse(
184
            @Parameter(name = "id") @RequestParam Long id,
185
            @Parameter(name = "name", description = "course name, e.g. CMPSC 156") @RequestParam String name,
186
            @Parameter(name = "school", description = "school abbreviation e.g. UCSB") @RequestParam String school,
187
            @Parameter(name = "term", description = "quarter or semester, e.g. F23") @RequestParam String term,
188
            @Parameter(name = "startDate", description = "in iso format, i.e. YYYY-mm-ddTHH:MM:SS; e.g. 2023-10-01T00:00:00 see https://en.wikipedia.org/wiki/ISO_8601") @RequestParam("startDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
189
            @Parameter(name = "endDate", description = "in iso format, i.e. YYYY-mm-ddTHH:MM:SS; e.g. 2023-12-31T11:59:59 see https://en.wikipedia.org/wiki/ISO_8601") @RequestParam("endDate") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate,
190
            @Parameter(name = "githubOrg", description = "for example ucsb-cs156-f23") @RequestParam String githubOrg)
191
            throws JsonProcessingException {
192
193
        Course course = courseRepository.findById(id)
194 1 1. lambda$updateCourse$6 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$updateCourse$6 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(Course.class, id.toString()));
195
196
        // Check if the current user is a staff member for this course or an admin. If
197
        // not, throw AccessDeniedException
198
199
        User u = getCurrentUser().getUser();
200 1 1. updateCourse : negated conditional → KILLED
        if (!u.isAdmin()) {
201
            courseStaffRepository.findByCourseIdAndGithubId(course.getId(), u.getGithubId())
202 1 1. lambda$updateCourse$7 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$updateCourse$7 → KILLED
                    .orElseThrow(() -> new AccessDeniedException(
203
                            "User is not a staff member for this course"));
204
        }
205
206 1 1. updateCourse : removed call to edu/ucsb/cs156/organic/entities/Course::setName → KILLED
        course.setName(name);
207 1 1. updateCourse : removed call to edu/ucsb/cs156/organic/entities/Course::setSchool → KILLED
        course.setSchool(school);
208 1 1. updateCourse : removed call to edu/ucsb/cs156/organic/entities/Course::setTerm → KILLED
        course.setTerm(term);
209 1 1. updateCourse : removed call to edu/ucsb/cs156/organic/entities/Course::setStartDate → KILLED
        course.setStartDate(startDate);
210 1 1. updateCourse : removed call to edu/ucsb/cs156/organic/entities/Course::setEndDate → KILLED
        course.setEndDate(endDate);
211 1 1. updateCourse : removed call to edu/ucsb/cs156/organic/entities/Course::setGithubOrg → KILLED
        course.setGithubOrg(githubOrg);
212
213
        course = courseRepository.save(course);
214
        log.info("course={}", course);
215
216 1 1. updateCourse : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::updateCourse → KILLED
        return course;
217
    }
218
219
    // delete a course if the user is an admin or instructor for the course
220
    @Operation(summary = "Delete a course")
221
    @PreAuthorize("hasAnyRole('ROLE_ADMIN', 'ROLE_INSTRUCTOR')")
222
    @DeleteMapping("/delete")
223
    public Course deleteCourse(
224
            @Parameter(name = "id") @RequestParam Long id)
225
            throws JsonProcessingException {
226
227
        Course course = courseRepository.findById(id)
228 1 1. lambda$deleteCourse$8 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$deleteCourse$8 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(Course.class, id.toString()));
229
230
        // Check if the current user is a staff member for this course or an admin. If
231
        // not, throw AccessDeniedException
232
233
        User u = getCurrentUser().getUser();
234 1 1. deleteCourse : negated conditional → KILLED
        if (!u.isAdmin()) {
235
            courseStaffRepository.findByCourseIdAndGithubId(course.getId(), u.getGithubId())
236 1 1. lambda$deleteCourse$9 : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$deleteCourse$9 → KILLED
                    .orElseThrow(() -> new AccessDeniedException(
237
                            "User is not a staff member for this course"));
238
        }
239
240 1 1. deleteCourse : removed call to edu/ucsb/cs156/organic/repositories/CourseRepository::delete → KILLED
        courseRepository.delete(course);
241 1 1. deleteCourse : replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::deleteCourse → KILLED
        return course;
242
    }
243
244
}

Mutations

59

1.1
Location : allCourses
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:admin_can_get_all_courses()]
negated conditional → KILLED

60

1.1
Location : allCourses
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:admin_can_get_all_courses()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::allCourses → KILLED

62

1.1
Location : allCourses
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:user_can_get_only_courses_for_which_they_are_staff()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::allCourses → KILLED

74

1.1
Location : lambda$getById$0
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:test_that_admin_cannot_get_by_id_when_the_id_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$getById$0 → KILLED

76

1.1
Location : getById
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:test_that_non_admin_non_instructor_cannot_get_an_existing_course()]
negated conditional → KILLED

78

1.1
Location : lambda$getById$1
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:test_that_non_admin_non_instructor_cannot_get_an_existing_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$getById$1 → KILLED

82

1.1
Location : getById
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:test_that_instructor_can_get_by_id_when_the_id_exists()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::getById → KILLED

99

1.1
Location : postCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_cannot_post_a_new_course_with_bad_endDate()]
negated conditional → KILLED

123

1.1
Location : postCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_can_post_a_new_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::postCourse → KILLED

135

1.1
Location : lambda$addStaff$2
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_cannot_add_staff_to_a_non_existing_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$addStaff$2 → KILLED

138

1.1
Location : lambda$addStaff$3
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_cannot_add_non_existing_user_to_staff_of_an_existing_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$addStaff$3 → KILLED

149

1.1
Location : addStaff
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_can_add_a_staff_member_to_a_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::addStaff → KILLED

160

1.1
Location : lambda$getStaff$4
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_cannot_get_staff_for_a_non_existing_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$getStaff$4 → KILLED

163

1.1
Location : getStaff
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_can_get_staff_for_a_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::getStaff → KILLED

172

1.1
Location : lambda$deleteStaff$5
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:admin_tries_to_delete_non_existant_course_staff_and_gets_right_error_message()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$deleteStaff$5 → KILLED

174

1.1
Location : deleteStaff
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:admin_can_delete_a_staff()]
removed call to edu/ucsb/cs156/organic/repositories/StaffRepository::delete → KILLED

175

1.1
Location : deleteStaff
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:admin_can_delete_a_staff()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::deleteStaff → KILLED

194

1.1
Location : lambda$updateCourse$6
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_cannot_update_non_existing_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$updateCourse$6 → KILLED

200

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_cannot_update_a_course_if_they_are_not_staff()]
negated conditional → KILLED

202

1.1
Location : lambda$updateCourse$7
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_cannot_update_a_course_if_they_are_not_staff()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$updateCourse$7 → KILLED

206

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/entities/Course::setName → KILLED

207

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/entities/Course::setSchool → KILLED

208

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/entities/Course::setTerm → KILLED

209

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/entities/Course::setStartDate → KILLED

210

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/entities/Course::setEndDate → KILLED

211

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/entities/Course::setGithubOrg → KILLED

216

1.1
Location : updateCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_update_a_course_if_they_are_staff()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::updateCourse → KILLED

228

1.1
Location : lambda$deleteCourse$8
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_admin_user_cannot_delete_non_existing_course()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$deleteCourse$8 → KILLED

234

1.1
Location : deleteCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_cannot_delete_a_course_if_they_are_not_staff()]
negated conditional → KILLED

236

1.1
Location : lambda$deleteCourse$9
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_cannot_delete_a_course_if_they_are_not_staff()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::lambda$deleteCourse$9 → KILLED

240

1.1
Location : deleteCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_delete_a_course_if_they_are_staff()]
removed call to edu/ucsb/cs156/organic/repositories/CourseRepository::delete → KILLED

241

1.1
Location : deleteCourse
Killed by : edu.ucsb.cs156.organic.controllers.CoursesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.organic.controllers.CoursesControllerTests]/[method:an_instructor_user_can_delete_a_course_if_they_are_staff()]
replaced return value with null for edu/ucsb/cs156/organic/controllers/CoursesController::deleteCourse → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3