PersonalSchedulesController.java

1
package edu.ucsb.cs156.courses.controllers;
2
3
import edu.ucsb.cs156.courses.entities.PSCourse;
4
import edu.ucsb.cs156.courses.entities.PersonalSchedule;
5
import edu.ucsb.cs156.courses.entities.User;
6
import edu.ucsb.cs156.courses.errors.EntityNotFoundException;
7
import edu.ucsb.cs156.courses.models.CurrentUser;
8
import edu.ucsb.cs156.courses.repositories.PSCourseRepository;
9
import edu.ucsb.cs156.courses.repositories.PersonalScheduleRepository;
10
import io.swagger.v3.oas.annotations.Operation;
11
import io.swagger.v3.oas.annotations.Parameter;
12
import io.swagger.v3.oas.annotations.tags.Tag;
13
import java.util.Optional;
14
import java.util.stream.StreamSupport;
15
import javax.validation.Valid;
16
import lombok.extern.slf4j.Slf4j;
17
import org.springframework.beans.factory.annotation.Autowired;
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.PostMapping;
22
import org.springframework.web.bind.annotation.PutMapping;
23
import org.springframework.web.bind.annotation.RequestBody;
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
@Tag(name = "PersonalSchedules")
29
@RequestMapping("/api/personalschedules")
30
@RestController
31
@Slf4j
32
public class PersonalSchedulesController extends ApiController {
33
34
  @Autowired PersonalScheduleRepository personalscheduleRepository;
35
  @Autowired PSCourseRepository coursesRepository;
36
37
  @Operation(summary = "List all personal schedules")
38
  @PreAuthorize("hasRole('ROLE_ADMIN')")
39
  @GetMapping("/admin/all")
40
  public Iterable<PersonalSchedule> allUsersSchedules() {
41
    Iterable<PersonalSchedule> personalschedules = personalscheduleRepository.findAll();
42 1 1. allUsersSchedules : replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::allUsersSchedules → KILLED
    return personalschedules;
43
  }
44
45
  @Operation(summary = "List this user's personal schedules")
46
  @PreAuthorize("hasRole('ROLE_USER')")
47
  @GetMapping("/all")
48
  public Iterable<PersonalSchedule> thisUsersSchedules() {
49
    CurrentUser currentUser = getCurrentUser();
50
    Iterable<PersonalSchedule> personalschedules =
51
        personalscheduleRepository.findAllByUserId(currentUser.getUser().getId());
52 1 1. thisUsersSchedules : replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::thisUsersSchedules → KILLED
    return personalschedules;
53
  }
54
55
  @Operation(summary = "Get a single personal schedule (if it belongs to current user)")
56
  @PreAuthorize("hasRole('ROLE_USER')")
57
  @GetMapping("")
58
  public PersonalSchedule getScheduleById(@Parameter(name = "id") @RequestParam Long id) {
59
    User currentUser = getCurrentUser().getUser();
60
    PersonalSchedule personalschedule =
61
        personalscheduleRepository
62
            .findByIdAndUser(id, currentUser)
63 1 1. lambda$getScheduleById$0 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$getScheduleById$0 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, id));
64
65 1 1. getScheduleById : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::getScheduleById → KILLED
    return personalschedule;
66
  }
67
68
  @Operation(summary = "Get a single personal schedule (no matter who it belongs to, admin only)")
69
  @PreAuthorize("hasRole('ROLE_ADMIN')")
70
  @GetMapping("/admin")
71
  public PersonalSchedule getScheduleById_admin(@Parameter(name = "id") @RequestParam Long id) {
72
    PersonalSchedule personalschedule =
73
        personalscheduleRepository
74
            .findById(id)
75 1 1. lambda$getScheduleById_admin$1 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$getScheduleById_admin$1 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, id));
76
77 1 1. getScheduleById_admin : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::getScheduleById_admin → KILLED
    return personalschedule;
78
  }
79
80
  @Operation(summary = "Create a new personal schedule")
81
  @PreAuthorize("hasRole('ROLE_USER')")
82
  @PostMapping("/post")
83
  public PersonalSchedule postSchedule(
84
      @Parameter(name = "name") @RequestParam String name,
85
      @Parameter(name = "description") @RequestParam String description,
86
      @Parameter(name = "quarter") @RequestParam String quarter) {
87
    CurrentUser currentUser = getCurrentUser();
88
    log.info("currentUser={}", currentUser);
89
90
    // Checks length of name parameter (length should be 15 chars or less, nonzero)
91 2 1. postSchedule : changed conditional boundary → KILLED
2. postSchedule : negated conditional → KILLED
    if (name.length() > 15) {
92
      throw new IllegalArgumentException("name parameter restricted to 15 chars or less");
93
    }
94
95
    PersonalSchedule personalschedule = new PersonalSchedule();
96 1 1. postSchedule : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setUser → KILLED
    personalschedule.setUser(currentUser.getUser());
97 1 1. postSchedule : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setName → KILLED
    personalschedule.setName(name);
98 1 1. postSchedule : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setDescription → KILLED
    personalschedule.setDescription(description);
99 1 1. postSchedule : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setQuarter → KILLED
    personalschedule.setQuarter(quarter);
100
101
    Optional<PersonalSchedule> existCheck =
102
        personalscheduleRepository.findByUserAndNameAndQuarter(
103
            currentUser.getUser(), name, quarter);
104 1 1. postSchedule : negated conditional → KILLED
    if (existCheck.isPresent()) {
105
      throw new IllegalArgumentException(
106
          "A personal schedule with that name already exists in that quarter");
107
    }
108
    PersonalSchedule savedPersonalSchedule = personalscheduleRepository.save(personalschedule);
109 1 1. postSchedule : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::postSchedule → KILLED
    return savedPersonalSchedule;
110
  }
111
112
  @Operation(summary = "Delete a personal schedule owned by this user")
113
  @PreAuthorize("hasRole('ROLE_USER')")
114
  @DeleteMapping("")
115
  public Object deleteSchedule(@Parameter(name = "id") @RequestParam Long id) {
116
    User currentUser = getCurrentUser().getUser();
117
    PersonalSchedule personalschedule =
118
        personalscheduleRepository
119
            .findByIdAndUser(id, currentUser)
120 1 1. lambda$deleteSchedule$2 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$deleteSchedule$2 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, id));
121
122 1 1. deleteSchedule : removed call to edu/ucsb/cs156/courses/repositories/PersonalScheduleRepository::delete → KILLED
    personalscheduleRepository.delete(personalschedule);
123
124
    Iterable<PSCourse> coursesToDelete = coursesRepository.findAllByPsId(id);
125
    for (PSCourse course : coursesToDelete) {
126 1 1. deleteSchedule : removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED
      coursesRepository.delete(course);
127
    }
128
129 1 1. deleteSchedule : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::deleteSchedule → KILLED
    return genericMessage("PersonalSchedule with id %s deleted".formatted(id));
130
  }
131
132
  @Operation(summary = "Delete another user's personal schedule")
133
  @PreAuthorize("hasRole('ROLE_ADMIN')")
134
  @DeleteMapping("/admin")
135
  public Object deleteSchedule_Admin(@Parameter(name = "id") @RequestParam Long id) {
136
    PersonalSchedule personalschedule =
137
        personalscheduleRepository
138
            .findById(id)
139 1 1. lambda$deleteSchedule_Admin$3 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$deleteSchedule_Admin$3 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, id));
140
141 1 1. deleteSchedule_Admin : removed call to edu/ucsb/cs156/courses/repositories/PersonalScheduleRepository::delete → KILLED
    personalscheduleRepository.delete(personalschedule);
142
143
    Iterable<PSCourse> coursesToDelete = coursesRepository.findAllByPsId(id);
144
    for (PSCourse course : coursesToDelete) {
145 1 1. deleteSchedule_Admin : removed call to edu/ucsb/cs156/courses/repositories/PSCourseRepository::delete → KILLED
      coursesRepository.delete(course);
146
    }
147
148 1 1. deleteSchedule_Admin : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::deleteSchedule_Admin → KILLED
    return genericMessage("PersonalSchedule with id %s deleted".formatted(id));
149
  }
150
151
  @Operation(summary = "Update a single personal schedule (if it belongs to current user)")
152
  @PreAuthorize("hasRole('ROLE_USER')")
153
  @PutMapping("")
154
  public PersonalSchedule putScheduleById(
155
      @Parameter(name = "id") @RequestParam Long id,
156
      @RequestBody @Valid PersonalSchedule incomingSchedule) {
157
    User currentUser = getCurrentUser().getUser();
158
    PersonalSchedule personalschedule =
159
        personalscheduleRepository
160
            .findByIdAndUser(id, currentUser)
161 1 1. lambda$putScheduleById$4 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$putScheduleById$4 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, id));
162
163
    Iterable<PersonalSchedule> allSchedules =
164
        personalscheduleRepository.findAllByUserId(currentUser.getId());
165
166
    boolean hasDuplicate =
167
        StreamSupport.stream(allSchedules.spliterator(), false)
168
            .anyMatch(
169
                schedule ->
170 2 1. lambda$putScheduleById$5 : negated conditional → KILLED
2. lambda$putScheduleById$5 : replaced boolean return with true for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$putScheduleById$5 → KILLED
                    schedule.getName().equals(incomingSchedule.getName())
171 1 1. lambda$putScheduleById$5 : negated conditional → KILLED
                        && schedule.getQuarter().equals(incomingSchedule.getQuarter())
172 1 1. lambda$putScheduleById$5 : negated conditional → KILLED
                        && schedule.getId() != personalschedule.getId());
173
174 1 1. putScheduleById : negated conditional → KILLED
    if (hasDuplicate) {
175
      throw new IllegalArgumentException(
176
          "A personal schedule with that name already exists in that quarter");
177
    }
178
179 1 1. putScheduleById : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setName → KILLED
    personalschedule.setName(incomingSchedule.getName());
180 1 1. putScheduleById : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setDescription → KILLED
    personalschedule.setDescription(incomingSchedule.getDescription());
181 1 1. putScheduleById : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setQuarter → KILLED
    personalschedule.setQuarter(incomingSchedule.getQuarter());
182
183
    personalscheduleRepository.save(personalschedule);
184
185 1 1. putScheduleById : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::putScheduleById → KILLED
    return personalschedule;
186
  }
187
188
  @Operation(
189
      summary =
190
          "Update a single Schedule (regardless of ownership, admin only, can't change ownership)")
191
  @PreAuthorize("hasRole('ROLE_ADMIN')")
192
  @PutMapping("/admin")
193
  public PersonalSchedule putScheduleById_admin(
194
      @Parameter(name = "id") @RequestParam Long id,
195
      @RequestBody @Valid PersonalSchedule incomingSchedule) {
196
    PersonalSchedule personalschedule =
197
        personalscheduleRepository
198
            .findById(id)
199 1 1. lambda$putScheduleById_admin$6 : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$putScheduleById_admin$6 → KILLED
            .orElseThrow(() -> new EntityNotFoundException(PersonalSchedule.class, id));
200
201 1 1. putScheduleById_admin : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setName → KILLED
    personalschedule.setName(incomingSchedule.getName());
202 1 1. putScheduleById_admin : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setDescription → KILLED
    personalschedule.setDescription(incomingSchedule.getDescription());
203 1 1. putScheduleById_admin : removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setQuarter → KILLED
    personalschedule.setQuarter(incomingSchedule.getQuarter());
204
205
    personalscheduleRepository.save(personalschedule);
206
207 1 1. putScheduleById_admin : replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::putScheduleById_admin → KILLED
    return personalschedule;
208
  }
209
}

Mutations

42

1.1
Location : allUsersSchedules
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules_admin_all__admin_logged_in__returns_all_schedules()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::allUsersSchedules → KILLED

52

1.1
Location : thisUsersSchedules
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules_all__user_logged_in__returns_only_schedules_for_user()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::thisUsersSchedules → KILLED

63

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

65

1.1
Location : getScheduleById
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__returns_a_schedules_that_exists()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::getScheduleById → KILLED

75

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

77

1.1
Location : getScheduleById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__admin_logged_in__search_for_schedule_that_belongs_to_another_user()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::getScheduleById_admin → KILLED

91

1.1
Location : postSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__can_post_15_char_name()]
changed conditional boundary → KILLED

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

96

1.1
Location : postSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__can_post_15_char_name()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setUser → KILLED

97

1.1
Location : postSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__can_post_15_char_name()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setName → KILLED

98

1.1
Location : postSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__can_post_15_char_name()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setDescription → KILLED

99

1.1
Location : postSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__can_post_15_char_name()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setQuarter → KILLED

104

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

109

1.1
Location : postSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__can_post_15_char_name()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::postSchedule → KILLED

120

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

122

1.1
Location : deleteSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__delete_schedule()]
removed call to edu/ucsb/cs156/courses/repositories/PersonalScheduleRepository::delete → KILLED

126

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

129

1.1
Location : deleteSchedule
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__user_logged_in__delete_schedule()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::deleteSchedule → KILLED

139

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

141

1.1
Location : deleteSchedule_Admin
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__admin_logged_in__delete_schedule()]
removed call to edu/ucsb/cs156/courses/repositories/PersonalScheduleRepository::delete → KILLED

145

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

148

1.1
Location : deleteSchedule_Admin
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__admin_logged_in__delete_schedule()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::deleteSchedule_Admin → KILLED

161

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

170

1.1
Location : lambda$putScheduleById$5
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:cannot_edit_personal_schedule_to_same_name_and_quarter()]
negated conditional → KILLED

2.2
Location : lambda$putScheduleById$5
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:can_edit_personal_schedule_to_diff_name_and_same_quarter()]
replaced boolean return with true for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::lambda$putScheduleById$5 → KILLED

171

1.1
Location : lambda$putScheduleById$5
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:cannot_edit_personal_schedule_to_same_name_and_quarter()]
negated conditional → KILLED

172

1.1
Location : lambda$putScheduleById$5
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:can_edit_personal_schedule_duplicate_id_should_not_count_as_duplicate()]
negated conditional → KILLED

174

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

179

1.1
Location : putScheduleById
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:can_edit_personal_schedule_to_diff_name_and_same_quarter()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setName → KILLED

180

1.1
Location : putScheduleById
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:can_edit_personal_schedule_to_diff_name_and_same_quarter()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setDescription → KILLED

181

1.1
Location : putScheduleById
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:can_edit_personal_schedule_to_same_name_and_diff_quarter()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setQuarter → KILLED

185

1.1
Location : putScheduleById
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:can_edit_personal_schedule_to_diff_name_and_same_quarter()]
replaced return value with null for edu/ucsb/cs156/courses/controllers/PersonalSchedulesController::putScheduleById → KILLED

199

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

201

1.1
Location : putScheduleById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__admin_logged_in__put_schedule()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setName → KILLED

202

1.1
Location : putScheduleById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__admin_logged_in__put_schedule()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setDescription → KILLED

203

1.1
Location : putScheduleById_admin
Killed by : edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.courses.controllers.PersonalSchedulesControllerTests]/[method:api_schedules__admin_logged_in__put_schedule()]
removed call to edu/ucsb/cs156/courses/entities/PersonalSchedule::setQuarter → KILLED

207

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

Active mutators

Tests examined


Report generated by PIT 1.17.0