RiderApplicationController.java

1
package edu.ucsb.cs156.gauchoride.controllers;
2
3
import edu.ucsb.cs156.gauchoride.entities.RiderApplication;
4
import edu.ucsb.cs156.gauchoride.errors.EntityNotFoundException;
5
import edu.ucsb.cs156.gauchoride.repositories.RiderApplicationRepository;
6
7
import io.swagger.v3.oas.annotations.tags.Tag;
8
import io.swagger.v3.oas.annotations.Operation;
9
import io.swagger.v3.oas.annotations.Parameter;
10
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.http.ResponseEntity;
13
import org.springframework.security.access.prepost.PreAuthorize;
14
import org.springframework.security.core.authority.SimpleGrantedAuthority;
15
import org.springframework.security.oauth2.jwt.NimbusReactiveJwtDecoder.SecretKeyReactiveJwtDecoderBuilder;
16
import org.springframework.web.bind.annotation.DeleteMapping;
17
import org.springframework.web.bind.annotation.GetMapping;
18
import org.springframework.web.bind.annotation.PostMapping;
19
import org.springframework.web.bind.annotation.PutMapping;
20
import org.springframework.web.bind.annotation.RequestBody;
21
import org.springframework.web.bind.annotation.RequestMapping;
22
import org.springframework.web.bind.annotation.RequestParam;
23
import org.springframework.web.bind.annotation.RestController;
24
25
import javax.validation.Valid;
26
27
import java.sql.Date;
28
import java.time.LocalDate;
29
import java.util.ArrayList;
30
import java.util.List;
31
32
33
@Tag(name = "Rider Application")
34
@RequestMapping("/api")
35
@RestController
36
37
public class RiderApplicationController extends ApiController {
38
39
    @Autowired
40
    RiderApplicationRepository riderApplicationRepository;
41
    
42
43
    // // Endpoints for ROLE_MEMBER
44
45
    @Operation(summary = "Create a new rider application with the current user as the requester")
46
    @PreAuthorize("hasRole('ROLE_MEMBER')")
47
    @PostMapping("/riderApplication/new")
48
    public RiderApplication postRiderApplication(
49
        @Parameter(name="perm_number", description="String, Perm number consisting of 7 characters", example = "1234567", required = true) 
50
        @RequestParam String perm_number,
51
52
        @Parameter(name="description", description="String, Please describe the mobility limitations that cause you to need to use the Gauchoride service. ", example = "My legs are broken", required = true) 
53
        @RequestParam String description
54
    )
55
    {
56
        RiderApplication riderApplication = new RiderApplication();
57
        // Get the current date
58
        LocalDate localDate = LocalDate.now();
59
        Date currentDate = Date.valueOf(localDate);
60
61 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setStatus → KILLED
        riderApplication.setStatus("pending");
62 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUserId → KILLED
        riderApplication.setUserId(getCurrentUser().getUser().getId());
63 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setEmail → KILLED
        riderApplication.setEmail(getCurrentUser().getUser().getEmail());
64 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setPerm_number → KILLED
        riderApplication.setPerm_number(perm_number);
65 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setCreated_date → KILLED
        riderApplication.setCreated_date(currentDate);
66 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUpdated_date → KILLED
        riderApplication.setUpdated_date(currentDate);
67 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setDescription → KILLED
        riderApplication.setDescription(description);
68 1 1. postRiderApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setNotes → KILLED
        riderApplication.setNotes("");
69
70
        RiderApplication savedApplication = riderApplicationRepository.save(riderApplication);
71 1 1. postRiderApplication : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::postRiderApplication → KILLED
        return savedApplication;
72
    };
73
74
    @Operation(summary = "Get all rider applications owned by the current user")
75
    @PreAuthorize("hasRole('ROLE_MEMBER')")
76
    @GetMapping("/rider")
77
    public Iterable<RiderApplication> allApplications()
78
    {
79
        Iterable<RiderApplication> applications;
80
        applications = riderApplicationRepository.findAllByUserId(getCurrentUser().getUser().getId());
81 1 1. allApplications : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::allApplications → KILLED
        return applications;
82
    };
83
84
    @Operation(summary = "Get a single rider application but only if owned by the current user")
85
    @PreAuthorize("hasRole('ROLE_MEMBER')")
86
    @GetMapping("/riderApplication")
87
    public RiderApplication getById(
88
                    @Parameter(name="id", description = "Long, Id of the RiderApplication to get", 
89
                    required = true)  
90
                    @RequestParam Long id)
91
    {
92
        RiderApplication application;
93
        application = riderApplicationRepository.findByIdAndUserId(id, getCurrentUser().getUser().getId())
94 1 1. lambda$getById$0 : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$getById$0 → KILLED
                    .orElseThrow(() -> new EntityNotFoundException(RiderApplication.class, id));
95 1 1. getById : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::getById → KILLED
        return application;
96
    };    
97
98
    @Operation(summary = "Edit an existing rider application but only if it is owned by the current user and the application is in the correct status")
99
    @PreAuthorize("hasRole('ROLE_MEMBER')")
100
    @PutMapping("/riderApplication")
101
    public ResponseEntity<Object> updateApplication(
102
                            @Parameter(name="id", description="long, Id of the Application to be edited", 
103
                            required = true)
104
                            @RequestParam Long id,
105
                            @RequestBody @Valid RiderApplication incoming)
106
    {
107
        RiderApplication application;
108
109
        application = riderApplicationRepository.findByIdAndUserId(id, getCurrentUser().getUser().getId())
110 1 1. lambda$updateApplication$1 : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$updateApplication$1 → KILLED
                    .orElseThrow(() -> new EntityNotFoundException(RiderApplication.class, id));
111
112 1 1. updateApplication : negated conditional → KILLED
        if ("pending".equals(application.getStatus()))
113
        {
114
            // Get the current date
115
            LocalDate localDate = LocalDate.now();
116
            Date currentDate = Date.valueOf(localDate);
117
118 1 1. updateApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setPerm_number → KILLED
            application.setPerm_number(incoming.getPerm_number());
119 1 1. updateApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUpdated_date → KILLED
            application.setUpdated_date(currentDate);
120 1 1. updateApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setDescription → KILLED
            application.setDescription(incoming.getDescription());
121
122
            riderApplicationRepository.save(application);
123 1 1. updateApplication : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::updateApplication → KILLED
            return ResponseEntity.ok(application);
124
        }
125
        else
126
        {
127
            String errorMessage = "RiderApplication with \"" + application.getStatus() + "\" status cannot be updated";
128 1 1. updateApplication : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::updateApplication → KILLED
            return ResponseEntity.badRequest().body(errorMessage);
129
        }
130
    }; 
131
132
    @Operation(summary = "Cancel an existing rider application but only if it is owned by the current user and the application is in the correct status")
133
    @PreAuthorize("hasRole('ROLE_MEMBER')")
134
    @PutMapping("/riderApplication/cancel")
135
    public Object cancelApplication(
136
                            @Parameter(name="id", description="long, Id of the Application to be edited", 
137
                            required = true)
138
                            @RequestParam Long id)
139
                            
140
    {
141
        RiderApplication application;
142
143
        application = riderApplicationRepository.findByIdAndUserId(id, getCurrentUser().getUser().getId())
144 1 1. lambda$cancelApplication$2 : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$cancelApplication$2 → KILLED
                    .orElseThrow(() -> new EntityNotFoundException(RiderApplication.class, id));
145
        
146 1 1. cancelApplication : negated conditional → KILLED
        if ("pending".equals(application.getStatus()))
147
        {
148
            // Get the current date
149
            LocalDate localDate = LocalDate.now();
150
            Date currentDate = Date.valueOf(localDate);
151
152 1 1. cancelApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setStatus → KILLED
            application.setStatus("cancelled");
153 1 1. cancelApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUpdated_date → KILLED
            application.setUpdated_date(currentDate);
154 1 1. cancelApplication : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setCancelled_date → KILLED
            application.setCancelled_date(currentDate);
155
            riderApplicationRepository.save(application);
156
157 1 1. cancelApplication : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::cancelApplication → KILLED
            return genericMessage("Application with id %s is deleted".formatted(id));
158
        }
159
        else
160
        {
161 1 1. cancelApplication : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::cancelApplication → KILLED
            return genericMessage("Application with \"%s\" status cannot be cancelled".formatted(application.getStatus()));
162
        }
163
    };
164
165
166
    // // Endpoints for ROLE_ADMIN
167
168
    @Operation(summary = "Get all rider applications")
169
    @PreAuthorize("hasRole('ROLE_ADMIN')")
170
    @GetMapping("/rider/admin/all")
171
    public Iterable<RiderApplication> allApplicationsAdmin()
172
    {
173
        Iterable<RiderApplication> applications;
174
        applications = riderApplicationRepository.findAll();
175 1 1. allApplicationsAdmin : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::allApplicationsAdmin → KILLED
        return applications;
176
    };
177
178
    @Operation(summary = "Get all pending rider applications")
179
    @PreAuthorize("hasRole('ROLE_ADMIN')")
180
    @GetMapping("/rider/admin/pending")
181
    public Iterable<RiderApplication> allPendingApplications()
182
    {
183
        Iterable<RiderApplication> pendingApplications;
184
        pendingApplications = riderApplicationRepository.findAllByStatus("pending");
185
186 1 1. allPendingApplications : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::allPendingApplications → KILLED
        return pendingApplications;
187
    };
188
189
    @Operation(summary = "Get a specific rider application")
190
    @PreAuthorize("hasRole('ROLE_ADMIN')")
191
    @GetMapping("/rider/admin")
192
    public RiderApplication specificApplication(
193
                            @Parameter(name="id", description="long, Id of the Application to find", 
194
                            required = true)
195
                            @RequestParam Long id)
196
    {
197
        RiderApplication application;
198
        application = riderApplicationRepository.findById(id)
199 1 1. lambda$specificApplication$3 : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$specificApplication$3 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(RiderApplication.class, id));
200 1 1. specificApplication : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::specificApplication → KILLED
        return application;
201
    };
202
203
    @Operation(summary = "Update the status/notes field of an application")
204
    @PreAuthorize("hasRole('ROLE_ADMIN')")
205
    @PutMapping("/rider/admin")
206
    public RiderApplication updateApplicationAdmin(
207
                            @Parameter(name="id", description="long, Id of the Application to be updated", 
208
                            required = true)
209
                            @RequestParam Long id,
210
211
                            @Parameter(name="status", description="String, New Status of the Application", 
212
                                        required = false)
213
                            @RequestParam String status,
214
215
                            @Parameter(name="notes", description="String, Notes to notify the Applicant", 
216
                                        required = false)
217
                            @RequestParam String notes)
218
    {
219
        RiderApplication application;
220
        application = riderApplicationRepository.findById(id)
221 1 1. lambda$updateApplicationAdmin$4 : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$updateApplicationAdmin$4 → KILLED
                .orElseThrow(() -> new EntityNotFoundException(RiderApplication.class, id));
222
223 1 1. updateApplicationAdmin : negated conditional → KILLED
        if (!status.isEmpty())
224
        {
225 1 1. updateApplicationAdmin : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setStatus → KILLED
            application.setStatus(status);
226
        }
227
228 1 1. updateApplicationAdmin : negated conditional → KILLED
        if (!notes.isEmpty())
229
        {
230 1 1. updateApplicationAdmin : removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setNotes → KILLED
            application.setNotes(notes);
231
        }      
232
        
233
        riderApplicationRepository.save(application);
234 1 1. updateApplicationAdmin : replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::updateApplicationAdmin → KILLED
        return application;
235
    };
236
237
}

Mutations

61

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setStatus → KILLED

62

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUserId → KILLED

63

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setEmail → KILLED

64

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setPerm_number → KILLED

65

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setCreated_date → KILLED

66

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUpdated_date → KILLED

67

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setDescription → KILLED

68

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setNotes → KILLED

71

1.1
Location : postRiderApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:a_member_can_post_a_new_riderApplication()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::postRiderApplication → KILLED

81

1.1
Location : allApplications
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:logged_in_member_can_get_all_their_own_rides()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::allApplications → KILLED

94

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

95

1.1
Location : getById
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_member_can_get_by_id_when_the_id_exists_and_user_id_matches()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::getById → KILLED

110

1.1
Location : lambda$updateApplication$1
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_cannot_edit_other_members_application()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$updateApplication$1 → KILLED

112

1.1
Location : updateApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_canot_edit_application_whose_status_is_not_pending()]
negated conditional → KILLED

118

1.1
Location : updateApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_edit_their_own_application_whose_status_is_pending()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setPerm_number → KILLED

119

1.1
Location : updateApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_edit_their_own_application_whose_status_is_pending()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUpdated_date → KILLED

120

1.1
Location : updateApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_edit_their_own_application_whose_status_is_pending()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setDescription → KILLED

123

1.1
Location : updateApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_edit_their_own_application_whose_status_is_pending()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::updateApplication → KILLED

128

1.1
Location : updateApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_canot_edit_application_whose_status_is_not_pending()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::updateApplication → KILLED

144

1.1
Location : lambda$cancelApplication$2
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_cannot_cancel_application_that_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$cancelApplication$2 → KILLED

146

1.1
Location : cancelApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_canot_cancel_application_whose_status_is_not_pending()]
negated conditional → KILLED

152

1.1
Location : cancelApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_cancel_their_own_application_whose_status_is_pending()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setStatus → KILLED

153

1.1
Location : cancelApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_cancel_their_own_application_whose_status_is_pending()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setUpdated_date → KILLED

154

1.1
Location : cancelApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_cancel_their_own_application_whose_status_is_pending()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setCancelled_date → KILLED

157

1.1
Location : cancelApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_can_cancel_their_own_application_whose_status_is_pending()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::cancelApplication → KILLED

161

1.1
Location : cancelApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:member_canot_cancel_application_whose_status_is_not_pending()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::cancelApplication → KILLED

175

1.1
Location : allApplicationsAdmin
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_can_get_all_applications()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::allApplicationsAdmin → KILLED

186

1.1
Location : allPendingApplications
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_can_get_no_pending_applications_when_they_do_not_exist()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::allPendingApplications → KILLED

199

1.1
Location : lambda$specificApplication$3
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:logged_in_admins_can_get_specific_application()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$specificApplication$3 → KILLED

200

1.1
Location : specificApplication
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_can_get_by_id_when_id_exists()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::specificApplication → KILLED

221

1.1
Location : lambda$updateApplicationAdmin$4
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_cannot_update_when_the_application_does_not_exist()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::lambda$updateApplicationAdmin$4 → KILLED

223

1.1
Location : updateApplicationAdmin
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_can_update_status_and_notes_when_the_application_exists()]
negated conditional → KILLED

225

1.1
Location : updateApplicationAdmin
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_can_update_status_and_notes_when_the_application_exists()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setStatus → KILLED

228

1.1
Location : updateApplicationAdmin
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_can_update_status_and_notes_when_the_application_exists()]
negated conditional → KILLED

230

1.1
Location : updateApplicationAdmin
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_can_update_status_and_notes_when_the_application_exists()]
removed call to edu/ucsb/cs156/gauchoride/entities/RiderApplication::setNotes → KILLED

234

1.1
Location : updateApplicationAdmin
Killed by : edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.gauchoride.controllers.RiderApplicationControllerTests]/[method:test_that_logged_in_admin_can_update_status_and_notes_when_the_application_exists()]
replaced return value with null for edu/ucsb/cs156/gauchoride/controllers/RiderApplicationController::updateApplicationAdmin → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3