PSCourseController.java

1
package edu.ucsb.cs156.courses.controllers;
2
3
import edu.ucsb.cs156.courses.entities.PSCourse;
4
import edu.ucsb.cs156.courses.entities.User;
5
import edu.ucsb.cs156.courses.errors.EntityNotFoundException;
6
import edu.ucsb.cs156.courses.models.CurrentUser;
7
import edu.ucsb.cs156.courses.repositories.PSCourseRepository;
8
import io.swagger.annotations.Api;
9
import io.swagger.annotations.ApiOperation;
10
import io.swagger.annotations.ApiParam;
11
import io.swagger.annotations.ApiResponse;
12
import lombok.extern.slf4j.Slf4j;
13
14
import com.fasterxml.jackson.core.JsonProcessingException;
15
import com.fasterxml.jackson.databind.ObjectMapper;
16
import com.fasterxml.jackson.databind.JsonNode;
17
18
import org.springframework.beans.factory.annotation.Autowired;
19
import org.springframework.http.ResponseEntity;
20
import org.springframework.security.access.prepost.PreAuthorize;
21
import org.springframework.web.bind.annotation.DeleteMapping;
22
import org.springframework.web.bind.annotation.GetMapping;
23
import org.springframework.web.bind.annotation.PostMapping;
24
import org.springframework.web.bind.annotation.PutMapping;
25
import org.springframework.web.bind.annotation.RequestBody;
26
import org.springframework.web.bind.annotation.RequestMapping;
27
import org.springframework.web.bind.annotation.RequestParam;
28
import org.springframework.web.bind.annotation.RestController;
29
30
import javax.validation.Valid;
31
import java.util.Iterator;
32
import java.util.Optional;
33
import java.util.ArrayList;
34
35
import edu.ucsb.cs156.courses.entities.PersonalSchedule;
36
import edu.ucsb.cs156.courses.repositories.PersonalScheduleRepository;
37
import edu.ucsb.cs156.courses.services.UCSBCurriculumService;
38
import edu.ucsb.cs156.courses.errors.BadEnrollCdException;
39
40
@Api(description = "PSCourse")
41
@RequestMapping("/api/courses")
42
@RestController
43
@Slf4j
44
public class PSCourseController extends ApiController {
45
46
    @Autowired
47
    PSCourseRepository coursesRepository;
48
    @Autowired
49
    PersonalScheduleRepository personalScheduleRepository;
50
    @Autowired
51
    UCSBCurriculumService ucsbCurriculumService;
52
    @Autowired
53
    ObjectMapper mapper;
54
55
    @ApiOperation(value = "List all courses (admin)")
56
    @PreAuthorize("hasRole('ROLE_ADMIN')")
57
    @GetMapping("/admin/all")
58
    public Iterable<PSCourse> allUsersCourses() {
59
        Iterable<PSCourse> courses = coursesRepository.findAll();
60 1 1. allUsersCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::allUsersCourses → KILLED
        return courses;
61
    }
62
63
    @ApiOperation(value = "List all courses (user)")
64
    @PreAuthorize("hasRole('ROLE_USER')")
65
    @GetMapping("/user/all")
66
    public Iterable<PSCourse> thisUsersCourses() {
67
        CurrentUser currentUser = getCurrentUser();
68
        Iterable<PSCourse> courses = coursesRepository.findAllByUserId(currentUser.getUser().getId());
69 1 1. thisUsersCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::thisUsersCourses → KILLED
        return courses;
70
    }
71
72
    @ApiOperation(value = "List all courses for a specified psId (admin)")
73
    @PreAuthorize("hasRole('ROLE_ADMIN')")
74
    @GetMapping("/admin/psid/all")
75
    public Iterable<PSCourse> allCoursesForPsId(
76
            @ApiParam("psId") @RequestParam Long psId) {
77
        Iterable<PSCourse> courses = coursesRepository.findAllByPsId(psId);
78 1 1. allCoursesForPsId : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::allCoursesForPsId → KILLED
        return courses;
79
    }
80
81
    @ApiOperation(value = "List all courses for a specified psId (user)")
82
    @PreAuthorize("hasRole('ROLE_USER')")
83
    @GetMapping("/user/psid/all")
84
    public Iterable<PSCourse> thisUsersCoursesForPsId(
85
            @ApiParam("psId") @RequestParam Long psId) {
86
        User currentUser = getCurrentUser().getUser();
87
        Iterable<PSCourse> courses = coursesRepository.findAllByPsIdAndUser(psId, currentUser);
88 1 1. thisUsersCoursesForPsId : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::thisUsersCoursesForPsId → KILLED
        return courses;
89
    }
90
91
    @ApiOperation(value = "Get a single course (admin)")
92
    @PreAuthorize("hasRole('ROLE_ADMIN')")
93
    @GetMapping("/admin")
94
    public PSCourse getCourseById_admin(
95
            @ApiParam("id") @RequestParam Long id) {
96
        PSCourse courses = coursesRepository.findById(id)
97 1 1. lambda$getCourseById_admin$0 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$getCourseById_admin$0 → KILLED
          .orElseThrow(() -> new EntityNotFoundException(PSCourse.class, id));
98
99 1 1. getCourseById_admin : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::getCourseById_admin → KILLED
        return courses;
100
    }
101
102
    @ApiOperation(value = "Get a single course (user)")
103
    @PreAuthorize("hasRole('ROLE_USER')")
104
    @GetMapping("/user")
105
    public PSCourse getCourseById(
106
            @ApiParam("id") @RequestParam Long id) {
107
        User currentUser = getCurrentUser().getUser();
108
        PSCourse courses = coursesRepository.findByIdAndUser(id, currentUser)
109 1 1. lambda$getCourseById$1 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$getCourseById$1 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PSCourse.class, id));
110
111 1 1. getCourseById : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::getCourseById → KILLED
        return courses;
112
    }
113
114
    @ApiOperation(value = "Create a new course")
115
    @PreAuthorize("hasRole('ROLE_USER')")
116
    @PostMapping("/post")
117
    public ArrayList<PSCourse> postCourses(
118
            @ApiParam("enrollCd") @RequestParam String enrollCd,
119
            @ApiParam("psId") @RequestParam Long psId) throws JsonProcessingException {
120
        CurrentUser currentUser = getCurrentUser();
121
        log.info("currentUser={}", currentUser);
122
123
        PersonalSchedule checkPsId = personalScheduleRepository.findByIdAndUser(psId, currentUser.getUser())
124 1 1. lambda$postCourses$2 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$postCourses$2 → KILLED
        .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, psId));
125
126
        String body = ucsbCurriculumService.getAllSections(enrollCd, checkPsId.getQuarter());
127 2 1. postCourses : negated conditional → KILLED
2. postCourses : negated conditional → KILLED
        if(body.equals("{\"error\": \"401: Unauthorized\"}") || body.equals("{\"error\": \"Enroll code doesn't exist in that quarter.\"}")){
128
            throw new BadEnrollCdException(enrollCd);
129
        }
130
131
	String enrollCdPrimary = null;
132
	boolean hasSecondary = false;
133
	Iterator<JsonNode> it = mapper.readTree(body).path("classSections").elements();
134 1 1. postCourses : negated conditional → KILLED
	while (it.hasNext()) {
135
	    JsonNode classSection = it.next();
136
	    String section = classSection.path("section").asText();
137 1 1. postCourses : negated conditional → KILLED
	    if (section.endsWith("00")) {
138
		String currentEnrollCd = classSection.path("enrollCode").asText();
139
		enrollCdPrimary = currentEnrollCd;
140 1 1. postCourses : negated conditional → KILLED
		if (hasSecondary)
141
		    break;
142
	    } else {
143
		hasSecondary = true;
144
	    }
145
	}
146
147 1 1. postCourses : negated conditional → KILLED
	if (enrollCdPrimary == null) {
148
	    enrollCdPrimary = enrollCd;
149
	    hasSecondary = false;
150
	}
151
152 1 1. postCourses : negated conditional → KILLED
	if (coursesRepository.findByPsIdAndEnrollCd(psId, enrollCdPrimary).isPresent()) {
153
	    throw new IllegalArgumentException("class exists in schedule");
154
        }
155
	
156
	ArrayList<PSCourse> savedCourses = new ArrayList<>();
157
158 1 1. postCourses : negated conditional → KILLED
	if (!enrollCdPrimary.equals(enrollCd)) {
159
	    String enrollCdSecondary = enrollCd;
160
	    PSCourse secondary = new PSCourse();
161 1 1. postCourses : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setUser → KILLED
	    secondary.setUser(currentUser.getUser());
162 1 1. postCourses : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED
	    secondary.setEnrollCd(enrollCdSecondary);
163 1 1. postCourses : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED
	    secondary.setPsId(psId);
164
	    PSCourse savedSecondary = coursesRepository.save(secondary);
165
	    savedCourses.add(savedSecondary);
166 1 1. postCourses : negated conditional → KILLED
	} else if (hasSecondary) {
167
	    throw new IllegalArgumentException(enrollCd + " is for a course with sections; please add a specific section and the lecture will be automatically added");
168
	}
169
170
	PSCourse primary = new PSCourse();
171 1 1. postCourses : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setUser → KILLED
	primary.setUser(currentUser.getUser());
172 1 1. postCourses : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED
	primary.setEnrollCd(enrollCdPrimary);
173 1 1. postCourses : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED
	primary.setPsId(psId);
174
	PSCourse savedPrimary = coursesRepository.save(primary);
175
	savedCourses.add(savedPrimary);
176 1 1. postCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::postCourses → KILLED
        return savedCourses;
177
    }
178
179
    @ApiOperation(value = "Delete a course (admin)")
180
    @PreAuthorize("hasRole('ROLE_ADMIN')")
181
    @DeleteMapping("/admin")
182
    public Object deleteCourses_Admin(
183
            @ApiParam("id") @RequestParam Long id) {
184
              PSCourse courses = coursesRepository.findById(id)
185 1 1. lambda$deleteCourses_Admin$3 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$deleteCourses_Admin$3 → KILLED
          .orElseThrow(() -> new EntityNotFoundException(PSCourse.class, id));
186
187 1 1. deleteCourses_Admin : removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED
          coursesRepository.delete(courses);
188
189 1 1. deleteCourses_Admin : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses_Admin → KILLED
        return genericMessage("PSCourse with id %s deleted".formatted(id));
190
    }
191
192
    @ApiOperation(value = "Delete a course (user)")
193
    @PreAuthorize("hasRole('ROLE_USER')")
194
    @DeleteMapping("/user")
195
    public Object deleteCourses(
196
            @ApiParam("id") @RequestParam Long id) throws JsonProcessingException {
197
        User currentUser = getCurrentUser().getUser();
198
        PSCourse psCourse = coursesRepository.findByIdAndUser(id, currentUser)
199 1 1. lambda$deleteCourses$4 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$deleteCourses$4 → KILLED
          .orElseThrow(() -> new EntityNotFoundException(PSCourse.class, id));
200
	long psId = psCourse.getPsId();
201
	PersonalSchedule checkPsId = personalScheduleRepository.findByIdAndUser(psId, currentUser)
202 1 1. lambda$deleteCourses$5 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$deleteCourses$5 → KILLED
	  .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, psId));
203
	
204
	String body = ucsbCurriculumService.getAllSections(psCourse.getEnrollCd(), checkPsId.getQuarter());
205 2 1. deleteCourses : negated conditional → KILLED
2. deleteCourses : negated conditional → KILLED
        if (body.equals("{\"error\": \"401: Unauthorized\"}") || body.equals("{\"error\": \"Enroll code doesn't exist in that quarter.\"}")) {
206 1 1. deleteCourses : removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED
	    coursesRepository.delete(psCourse);
207 1 1. deleteCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED
	    return genericMessage("PSCourse with id %s deleted".formatted(id));
208
        }
209
	
210
	Iterator<JsonNode> it = mapper.readTree(body).path("classSections").elements();
211
	Optional<Long> primaryId = Optional.empty();
212
	Optional<Long> secondaryId = Optional.empty();
213 1 1. deleteCourses : negated conditional → KILLED
	while (it.hasNext()) {
214
	    JsonNode classSection = it.next();
215
	    String section = classSection.path("section").asText();
216
	    String currentEnrollCd = classSection.path("enrollCode").asText();
217
	    Optional<PSCourse> currentPsCourse = coursesRepository.findByPsIdAndEnrollCd(psId, currentEnrollCd);
218 1 1. deleteCourses : negated conditional → KILLED
	    if (!currentPsCourse.isPresent())
219
		continue;
220
	    Optional<Long> idOpt = Optional.of(currentPsCourse.get().getId());
221 1 1. deleteCourses : negated conditional → KILLED
	    if (section.endsWith("00"))
222
		primaryId = idOpt;
223
	    else
224
		secondaryId = idOpt;
225 1 1. deleteCourses : removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED
	    coursesRepository.delete(currentPsCourse.get());
226
	}
227
	
228 2 1. deleteCourses : negated conditional → KILLED
2. deleteCourses : negated conditional → KILLED
	if (primaryId.isPresent() && secondaryId.isPresent()) {
229 1 1. deleteCourses : negated conditional → KILLED
	    if (primaryId.get() == id)
230 1 1. deleteCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED
		return genericMessage("PSCourse with id %s and matching secondary with id %s deleted".formatted(id, secondaryId.get()));
231
	    else
232 1 1. deleteCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED
		return genericMessage("PSCourse with id %s and matching primary with id %s deleted".formatted(id, primaryId.get()));
233
	}
234
	
235 1 1. deleteCourses : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED
	return genericMessage("PSCourse with id %s deleted".formatted(id));
236
    }
237
238
    @ApiOperation(value = "Update a single Course (admin)")
239
    @PreAuthorize("hasRole('ROLE_ADMIN')")
240
    @PutMapping("/admin")
241
    public PSCourse putCourseById_admin(
242
            @ApiParam("id") @RequestParam Long id,
243
            @RequestBody @Valid PSCourse incomingCourses) {
244
              PSCourse courses = coursesRepository.findById(id)
245 1 1. lambda$putCourseById_admin$6 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$putCourseById_admin$6 → KILLED
          .orElseThrow(() -> new EntityNotFoundException(PSCourse.class, id));
246
247 1 1. putCourseById_admin : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED
          courses.setEnrollCd(incomingCourses.getEnrollCd());
248 1 1. putCourseById_admin : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED
          courses.setPsId(incomingCourses.getPsId());
249
250
        coursesRepository.save(courses);
251
252 1 1. putCourseById_admin : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::putCourseById_admin → KILLED
        return courses;
253
    }
254
255
    @ApiOperation(value = "Update a single course (user)")
256
    @PreAuthorize("hasRole('ROLE_USER')")
257
    @PutMapping("/user")
258
    public PSCourse putCoursesById(
259
            @ApiParam("id") @RequestParam Long id,
260
            @RequestBody @Valid PSCourse incomingCourses) {
261
        User currentUser = getCurrentUser().getUser();
262
        PSCourse courses = coursesRepository.findByIdAndUser(id, currentUser)
263 1 1. lambda$putCoursesById$7 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$putCoursesById$7 → KILLED
          .orElseThrow(() -> new EntityNotFoundException(PSCourse.class, id));
264
265 1 1. putCoursesById : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED
        courses.setEnrollCd(incomingCourses.getEnrollCd());
266 1 1. putCoursesById : removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED
        courses.setPsId(incomingCourses.getPsId());
267
268
        coursesRepository.save(courses);
269
270 1 1. putCoursesById : replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::putCoursesById → KILLED
        return courses;
271
    }
272
}

Mutations

60

1.1
Location : allUsersCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_admin_all__admin_logged_in__returns_all_courses()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::allUsersCourses → KILLED

69

1.1
Location : thisUsersCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_all__user_logged_in__returns_only_courses_for_user()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::thisUsersCourses → KILLED

78

1.1
Location : allCoursesForPsId
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__returns_a_courses_that_exists_using_psid()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::allCoursesForPsId → KILLED

88

1.1
Location : thisUsersCoursesForPsId
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__returns_a_courses_that_exists_using_psid()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::thisUsersCoursesForPsId → KILLED

97

1.1
Location : lambda$getCourseById_admin$0
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__search_for_course_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$getCourseById_admin$0 → KILLED

99

1.1
Location : getCourseById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__search_for_course_that_belongs_to_another_user()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::getCourseById_admin → KILLED

109

1.1
Location : lambda$getCourseById$1
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__search_for_courses_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$getCourseById$1 → KILLED

111

1.1
Location : getCourseById
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__returns_a_courses_that_exists()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::getCourseById → KILLED

124

1.1
Location : lambda$postCourses$2
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:apiCoursesUserCreatesCourseWithInvalidPSID()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$postCourses$2 → KILLED

127

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:apiCoursesUserCreatesCourseWithInvalidEnrollCd2()]
negated conditional → KILLED

2.2
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:apiCoursesUserCreatesCourseWithInvalidEnrollCd()]
negated conditional → KILLED

134

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

137

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

140

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

147

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

152

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

158

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

161

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__secondary_enroll_code_adds_secondary_and_primary()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setUser → KILLED

162

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__secondary_enroll_code_adds_secondary_and_primary()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED

163

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__secondary_enroll_code_adds_secondary_and_primary()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED

166

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__primary_enroll_code_has_one_secondary()]
negated conditional → KILLED

171

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__unexpected_ucsb_api_response_assumes_primary_course()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setUser → KILLED

172

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__unexpected_ucsb_api_response_assumes_primary_course()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED

173

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__unexpected_ucsb_api_response_assumes_primary_course()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED

176

1.1
Location : postCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses_post__user_logged_in__unexpected_ucsb_api_response_assumes_primary_course()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::postCourses → KILLED

185

1.1
Location : lambda$deleteCourses_Admin$3
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__cannot_delete_course_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$deleteCourses_Admin$3 → KILLED

187

1.1
Location : deleteCourses_Admin
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__delete_course()]
removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED

189

1.1
Location : deleteCourses_Admin
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__delete_course()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses_Admin → KILLED

199

1.1
Location : lambda$deleteCourses$4
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__cannot_delete_delete_belonging_to_another_user()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$deleteCourses$4 → KILLED

202

1.1
Location : lambda$deleteCourses$5
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course_with_personal_schedule_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$deleteCourses$5 → KILLED

205

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__ucsb_api__unauthorized_error__treat_as_primary()]
negated conditional → KILLED

2.2
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__ucsb_api__enroll_code_does_not_exist_error__treat_as_primary()]
negated conditional → KILLED

206

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__ucsb_api__unauthorized_error__treat_as_primary()]
removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED

207

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__ucsb_api__unauthorized_error__treat_as_primary()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED

213

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
negated conditional → KILLED

218

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
negated conditional → KILLED

221

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
negated conditional → KILLED

225

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED

228

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
negated conditional → KILLED

2.2
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
negated conditional → KILLED

229

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
negated conditional → KILLED

230

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__primary_with_multiple_secondaries()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED

232

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__secondary_with_primary()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED

235

1.1
Location : deleteCourses
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__delete_course__primary_with_no_secondary()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::deleteCourses → KILLED

245

1.1
Location : lambda$putCourseById_admin$6
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__admin_logged_in__cannot_put_course_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$putCourseById_admin$6 → KILLED

247

1.1
Location : putCourseById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_schedules__admin_logged_in__put_schedule()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED

248

1.1
Location : putCourseById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_schedules__admin_logged_in__put_schedule()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED

252

1.1
Location : putCourseById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_schedules__admin_logged_in__put_schedule()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::putCourseById_admin → KILLED

263

1.1
Location : lambda$putCoursesById$7
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__cannot_put_course_for_another_user()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::lambda$putCoursesById$7 → KILLED

265

1.1
Location : putCoursesById
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__put_course()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setEnrollCd → KILLED

266

1.1
Location : putCoursesById
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__put_course()]
removed call to edu/ucsb/cs156/courses/entities/PSCourse::setPsId → KILLED

270

1.1
Location : putCoursesById
Killed by : edu.ucsb.cs156.courses.controllers.PSCourseControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PSCourseControllerTests]/[method:api_courses__user_logged_in__put_course()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PSCourseController::putCoursesById → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3