JobsController.java

1
package edu.ucsb.cs156.jobs.controllers;
2
3
import edu.ucsb.cs156.jobs.entities.Job;
4
import edu.ucsb.cs156.jobs.entities.JobLog;
5
import edu.ucsb.cs156.jobs.errors.EntityNotFoundException;
6
import edu.ucsb.cs156.jobs.repositories.JobsRepository;
7
import edu.ucsb.cs156.jobs.services.JobService;
8
import io.swagger.v3.oas.annotations.Operation;
9
import io.swagger.v3.oas.annotations.Parameter;
10
import io.swagger.v3.oas.annotations.tags.Tag;
11
import java.util.Arrays;
12
import java.util.List;
13
import java.util.Map;
14
import lombok.extern.slf4j.Slf4j;
15
import org.springframework.beans.factory.annotation.Autowired;
16
import org.springframework.data.domain.Page;
17
import org.springframework.data.domain.PageRequest;
18
import org.springframework.data.domain.Sort.Direction;
19
import org.springframework.data.jpa.domain.Specification;
20
import org.springframework.http.HttpStatus;
21
import org.springframework.security.access.prepost.PreAuthorize;
22
import org.springframework.web.bind.annotation.DeleteMapping;
23
import org.springframework.web.bind.annotation.ExceptionHandler;
24
import org.springframework.web.bind.annotation.GetMapping;
25
import org.springframework.web.bind.annotation.PathVariable;
26
import org.springframework.web.bind.annotation.RequestMapping;
27
import org.springframework.web.bind.annotation.RequestParam;
28
import org.springframework.web.bind.annotation.ResponseStatus;
29
import org.springframework.web.bind.annotation.RestController;
30
31
/**
32
 * Admin REST API for job records: list (all or paginated, filterable, sortable by any field), fetch
33
 * one, fetch logs (full or incremental tail), delete one or all. Launch endpoints stay in each
34
 * app's own controllers. Requires {@code ROLE_ADMIN}, which consuming apps must support via method
35
 * security ({@code @EnableMethodSecurity}).
36
 */
37
@Tag(name = "Jobs")
38
@RequestMapping("/api/jobs")
39
@RestController
40
@Slf4j
41
public class JobsController {
42
  public static final List<String> ALLOWED_SORT_FIELDS =
43
      Arrays.asList(
44
          "id",
45
          "jobName",
46
          "status",
47
          "createdByEmail",
48
          "scopeType",
49
          "scopeId",
50
          "createdAt",
51
          "updatedAt");
52
53
  /** Number of trailing log lines included as a preview on list/paginated responses. */
54
  public static final int LOG_PREVIEW_LINES = 10;
55
56
  @Autowired private JobsRepository jobsRepository;
57
58
  @Autowired private JobService jobService;
59
60
  @Operation(summary = "List all jobs")
61
  @PreAuthorize("hasRole('ROLE_ADMIN')")
62
  @GetMapping("/all")
63
  public Iterable<Job> allJobs() {
64
    Iterable<Job> jobs = jobsRepository.findAllByOrderByIdDesc();
65 1 1. allJobs : removed call to java/lang/Iterable::forEach → KILLED
    jobs.forEach(this::populateLogPreview);
66 1 1. allJobs : replaced return value with Collections.emptyList for edu/ucsb/cs156/jobs/controllers/JobsController::allJobs → KILLED
    return jobs;
67
  }
68
69
  @Operation(
70
      summary = "Get a paginated, optionally filtered, list of jobs, sortable by any allowed field")
71
  @PreAuthorize("hasRole('ROLE_ADMIN')")
72
  @GetMapping(value = "/paginated", produces = "application/json")
73
  public Page<Job> paginatedJobs(
74
      @Parameter(name = "page", description = "what page of the data", example = "0") @RequestParam
75
          int page,
76
      @Parameter(name = "pageSize", description = "size of each page", example = "10") @RequestParam
77
          int pageSize,
78
      @Parameter(name = "sortField", description = "sort field", example = "createdAt")
79
          @RequestParam(defaultValue = "status")
80
          String sortField,
81
      @Parameter(name = "sortDirection", description = "sort direction", example = "ASC")
82
          @RequestParam(defaultValue = "DESC")
83
          String sortDirection,
84
      @Parameter(name = "status", description = "exact match, e.g. \"running\"")
85
          @RequestParam(required = false)
86
          String status,
87
      @Parameter(name = "jobName", description = "case-insensitive substring match")
88
          @RequestParam(required = false)
89
          String jobName,
90
      @Parameter(name = "createdByEmail", description = "case-insensitive substring match")
91
          @RequestParam(required = false)
92
          String createdByEmail,
93
      @Parameter(name = "scopeType", description = "exact match, e.g. \"course\"")
94
          @RequestParam(required = false)
95
          String scopeType,
96
      @Parameter(name = "scopeId", description = "exact match") @RequestParam(required = false)
97
          Long scopeId) {
98
99 1 1. paginatedJobs : negated conditional → KILLED
    if (!ALLOWED_SORT_FIELDS.contains(sortField)) {
100
      throw new IllegalArgumentException(
101
          String.format(
102
              "%s is not a valid sort field. Valid values are %s", sortField, ALLOWED_SORT_FIELDS));
103
    }
104
105
    List<String> allowedSortDirections = Arrays.asList("ASC", "DESC");
106 1 1. paginatedJobs : negated conditional → KILLED
    if (!allowedSortDirections.contains(sortDirection)) {
107
      throw new IllegalArgumentException(
108
          String.format(
109
              "%s is not a valid sort direction. Valid values are %s",
110
              sortDirection, allowedSortDirections));
111
    }
112
113
    Direction sortDirectionObject = Direction.DESC;
114 1 1. paginatedJobs : negated conditional → KILLED
    if (sortDirection.equals("ASC")) {
115
      sortDirectionObject = Direction.ASC;
116
    }
117
118
    Specification<Job> spec = Specification.where(null);
119 2 1. paginatedJobs : negated conditional → KILLED
2. paginatedJobs : negated conditional → KILLED
    if (status != null && !status.isEmpty()) {
120 1 1. lambda$paginatedJobs$e0ae5173$1 : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$e0ae5173$1 → KILLED
      spec = spec.and((root, query, cb) -> cb.equal(root.get("status"), status));
121
    }
122 2 1. paginatedJobs : negated conditional → KILLED
2. paginatedJobs : negated conditional → KILLED
    if (jobName != null && !jobName.isEmpty()) {
123
      String pattern = "%" + jobName.toLowerCase() + "%";
124 1 1. lambda$paginatedJobs$30c6c2c3$1 : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$30c6c2c3$1 → KILLED
      spec = spec.and((root, query, cb) -> cb.like(cb.lower(root.get("jobName")), pattern));
125
    }
126 2 1. paginatedJobs : negated conditional → KILLED
2. paginatedJobs : negated conditional → KILLED
    if (createdByEmail != null && !createdByEmail.isEmpty()) {
127
      String pattern = "%" + createdByEmail.toLowerCase() + "%";
128 1 1. lambda$paginatedJobs$30c6c2c3$2 : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$30c6c2c3$2 → KILLED
      spec = spec.and((root, query, cb) -> cb.like(cb.lower(root.get("createdByEmail")), pattern));
129
    }
130 2 1. paginatedJobs : negated conditional → KILLED
2. paginatedJobs : negated conditional → KILLED
    if (scopeType != null && !scopeType.isEmpty()) {
131 1 1. lambda$paginatedJobs$42e6cca5$1 : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$42e6cca5$1 → KILLED
      spec = spec.and((root, query, cb) -> cb.equal(root.get("scopeType"), scopeType));
132
    }
133 1 1. paginatedJobs : negated conditional → KILLED
    if (scopeId != null) {
134 1 1. lambda$paginatedJobs$67dbb88f$1 : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$67dbb88f$1 → KILLED
      spec = spec.and((root, query, cb) -> cb.equal(root.get("scopeId"), scopeId));
135
    }
136
137
    PageRequest pageRequest = PageRequest.of(page, pageSize, sortDirectionObject, sortField);
138
    Page<Job> result = jobsRepository.findAll(spec, pageRequest);
139 1 1. paginatedJobs : removed call to java/util/List::forEach → KILLED
    result.getContent().forEach(this::populateLogPreview);
140 1 1. paginatedJobs : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::paginatedJobs → KILLED
    return result;
141
  }
142
143
  @Operation(summary = "Get a specific job by ID if it is in the database")
144
  @PreAuthorize("hasRole('ROLE_ADMIN')")
145
  @GetMapping("")
146
  public Job getJobById(
147
      @Parameter(name = "id", description = "ID of the job") @RequestParam Long id) {
148
    Job job =
149 1 1. lambda$getJobById$0 : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$getJobById$0 → KILLED
        jobsRepository.findById(id).orElseThrow(() -> new EntityNotFoundException(Job.class, id));
150 1 1. getJobById : removed call to edu/ucsb/cs156/jobs/entities/Job::setLog → KILLED
    job.setLog(jobService.getJobLogs(id));
151 1 1. getJobById : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::getJobById → KILLED
    return job;
152
  }
153
154
  @Operation(summary = "Get long job logs")
155
  @PreAuthorize("hasRole('ROLE_ADMIN')")
156
  @GetMapping("/logs/{id}")
157
  public String getJobLogs(@Parameter(name = "id", description = "Job ID") @PathVariable Long id) {
158 1 1. getJobLogs : replaced return value with "" for edu/ucsb/cs156/jobs/controllers/JobsController::getJobLogs → KILLED
    return jobService.getJobLogs(id);
159
  }
160
161
  @Operation(
162
      summary =
163
          "Get log lines written since afterId, for incremental live-tailing (poll with the "
164
              + "highest id you've already seen)")
165
  @PreAuthorize("hasRole('ROLE_ADMIN')")
166
  @GetMapping("/logs/{id}/tail")
167
  public List<JobLog> getJobLogTail(
168
      @Parameter(name = "id", description = "Job ID") @PathVariable Long id,
169
      @Parameter(name = "afterId", description = "only return lines with id greater than this")
170
          @RequestParam(defaultValue = "0")
171
          Long afterId) {
172 1 1. getJobLogTail : replaced return value with Collections.emptyList for edu/ucsb/cs156/jobs/controllers/JobsController::getJobLogTail → KILLED
    return jobService.getJobLogTail(id, afterId);
173
  }
174
175
  @Operation(summary = "Delete specific job record")
176
  @PreAuthorize("hasRole('ROLE_ADMIN')")
177
  @DeleteMapping("")
178
  public Map<String, String> deleteJob(@Parameter(name = "id") @RequestParam Long id) {
179 1 1. deleteJob : negated conditional → KILLED
    if (!jobsRepository.existsById(id)) {
180 1 1. deleteJob : replaced return value with Collections.emptyMap for edu/ucsb/cs156/jobs/controllers/JobsController::deleteJob → KILLED
      return Map.of("message", String.format("Job with id %d not found", id));
181
    }
182 1 1. deleteJob : removed call to edu/ucsb/cs156/jobs/repositories/JobsRepository::deleteById → KILLED
    jobsRepository.deleteById(id);
183 1 1. deleteJob : replaced return value with Collections.emptyMap for edu/ucsb/cs156/jobs/controllers/JobsController::deleteJob → KILLED
    return Map.of("message", String.format("Job with id %d deleted", id));
184
  }
185
186
  @Operation(summary = "Delete all job records")
187
  @PreAuthorize("hasRole('ROLE_ADMIN')")
188
  @DeleteMapping("/all")
189
  public Map<String, String> deleteAllJobs() {
190 1 1. deleteAllJobs : removed call to edu/ucsb/cs156/jobs/repositories/JobsRepository::deleteAll → KILLED
    jobsRepository.deleteAll();
191 1 1. deleteAllJobs : replaced return value with Collections.emptyMap for edu/ucsb/cs156/jobs/controllers/JobsController::deleteAllJobs → KILLED
    return Map.of("message", "All jobs deleted");
192
  }
193
194
  private void populateLogPreview(Job job) {
195 1 1. populateLogPreview : removed call to edu/ucsb/cs156/jobs/entities/Job::setLog → KILLED
    job.setLog(jobService.getJobLogPreview(job.getId()));
196
  }
197
198
  /**
199
   * The apps map these exceptions in an app-level base controller; the library controller cannot
200
   * extend that, so it carries its own handlers with the same response shape.
201
   */
202
  @ExceptionHandler({EntityNotFoundException.class})
203
  @ResponseStatus(HttpStatus.NOT_FOUND)
204
  public Object handleEntityNotFoundException(Throwable e) {
205 1 1. handleEntityNotFoundException : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::handleEntityNotFoundException → KILLED
    return Map.of(
206
        "type", e.getClass().getSimpleName(),
207
        "message", e.getMessage());
208
  }
209
210
  @ExceptionHandler({IllegalArgumentException.class})
211
  @ResponseStatus(HttpStatus.BAD_REQUEST)
212
  public Object handleIllegalArgument(Throwable e) {
213 1 1. handleIllegalArgument : replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::handleIllegalArgument → KILLED
    return Map.of(
214
        "type", e.getClass().getSimpleName(),
215
        "message", e.getMessage());
216
  }
217
}

Mutations

65

1.1
Location : allJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_list_all_jobs()]
removed call to java/lang/Iterable::forEach → KILLED

66

1.1
Location : allJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_list_all_jobs()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/jobs/controllers/JobsController::allJobs → KILLED

99

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:paginated_rejects_invalid_sort_direction()]
negated conditional → KILLED

106

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:paginated_rejects_invalid_sort_direction()]
negated conditional → KILLED

114

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
negated conditional → KILLED

119

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:empty_string_filter_params_are_treated_as_absent()]
negated conditional → KILLED

2.2
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
negated conditional → KILLED

120

1.1
Location : lambda$paginatedJobs$e0ae5173$1
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_exact_status()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$e0ae5173$1 → KILLED

122

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
negated conditional → KILLED

2.2
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_jobName_case_insensitive_substring()]
negated conditional → KILLED

124

1.1
Location : lambda$paginatedJobs$30c6c2c3$1
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_jobName_case_insensitive_substring()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$30c6c2c3$1 → KILLED

126

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
negated conditional → KILLED

2.2
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_createdByEmail_case_insensitive_substring()]
negated conditional → KILLED

128

1.1
Location : lambda$paginatedJobs$30c6c2c3$2
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_createdByEmail_case_insensitive_substring()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$30c6c2c3$2 → KILLED

130

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
negated conditional → KILLED

2.2
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:empty_string_filter_params_are_treated_as_absent()]
negated conditional → KILLED

131

1.1
Location : lambda$paginatedJobs$42e6cca5$1
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_scopeType()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$42e6cca5$1 → KILLED

133

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_jobName_case_insensitive_substring()]
negated conditional → KILLED

134

1.1
Location : lambda$paginatedJobs$67dbb88f$1
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerFilteringIntegrationTests]/[method:filters_by_scopeId()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$paginatedJobs$67dbb88f$1 → KILLED

139

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
removed call to java/util/List::forEach → KILLED

140

1.1
Location : paginatedJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_paginated_jobs_with_defaults()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::paginatedJobs → KILLED

149

1.1
Location : lambda$getJobById$0
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:get_job_by_id_returns_404_when_missing()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::lambda$getJobById$0 → KILLED

150

1.1
Location : getJobById
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_job_by_id()]
removed call to edu/ucsb/cs156/jobs/entities/Job::setLog → KILLED

151

1.1
Location : getJobById
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_job_by_id()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::getJobById → KILLED

158

1.1
Location : getJobLogs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_job_logs()]
replaced return value with "" for edu/ucsb/cs156/jobs/controllers/JobsController::getJobLogs → KILLED

172

1.1
Location : getJobLogTail
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_get_job_log_tail()]
replaced return value with Collections.emptyList for edu/ucsb/cs156/jobs/controllers/JobsController::getJobLogTail → KILLED

179

1.1
Location : deleteJob
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:delete_reports_missing_job()]
negated conditional → KILLED

180

1.1
Location : deleteJob
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:delete_reports_missing_job()]
replaced return value with Collections.emptyMap for edu/ucsb/cs156/jobs/controllers/JobsController::deleteJob → KILLED

182

1.1
Location : deleteJob
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_delete_a_job()]
removed call to edu/ucsb/cs156/jobs/repositories/JobsRepository::deleteById → KILLED

183

1.1
Location : deleteJob
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_delete_a_job()]
replaced return value with Collections.emptyMap for edu/ucsb/cs156/jobs/controllers/JobsController::deleteJob → KILLED

190

1.1
Location : deleteAllJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_delete_all_jobs()]
removed call to edu/ucsb/cs156/jobs/repositories/JobsRepository::deleteAll → KILLED

191

1.1
Location : deleteAllJobs
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_delete_all_jobs()]
replaced return value with Collections.emptyMap for edu/ucsb/cs156/jobs/controllers/JobsController::deleteAllJobs → KILLED

195

1.1
Location : populateLogPreview
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:admin_can_list_all_jobs()]
removed call to edu/ucsb/cs156/jobs/entities/Job::setLog → KILLED

205

1.1
Location : handleEntityNotFoundException
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:get_job_by_id_returns_404_when_missing()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::handleEntityNotFoundException → KILLED

213

1.1
Location : handleIllegalArgument
Killed by : edu.ucsb.cs156.jobs.controllers.JobsControllerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.controllers.JobsControllerTests]/[method:paginated_rejects_invalid_sort_direction()]
replaced return value with null for edu/ucsb/cs156/jobs/controllers/JobsController::handleIllegalArgument → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0