JobContextConsumer.java

1
package edu.ucsb.cs156.jobs.services;
2
3
/**
4
 * A concrete job: the code that runs asynchronously, receiving a {@link JobContext} for logging.
5
 * Apps implement this interface (or pass a lambda) and hand instances to {@link
6
 * JobService#runAsJob}.
7
 */
8
@FunctionalInterface
9
public interface JobContextConsumer {
10
  void accept(JobContext c) throws Exception;
11
12
  /** Name recorded on the {@code Job} row and shown in the admin UI. */
13
  default String getJobName() {
14 1 1. getJobName : replaced return value with "" for edu/ucsb/cs156/jobs/services/JobContextConsumer::getJobName → KILLED
    return getClass().getSimpleName();
15
  }
16
17
  /**
18
   * Optional scope: the kind of app-domain object this job belongs to (e.g. {@code "course"}). Null
19
   * (the default) means the job is unscoped.
20
   */
21
  default String getScopeType() {
22 1 1. getScopeType : replaced return value with "" for edu/ucsb/cs156/jobs/services/JobContextConsumer::getScopeType → KILLED
    return null;
23
  }
24
25
  /** Optional scope: the id of the app-domain object this job belongs to. */
26
  default Long getScopeId() {
27 1 1. getScopeId : replaced Long return value with 0L for edu/ucsb/cs156/jobs/services/JobContextConsumer::getScopeId → KILLED
    return null;
28
  }
29
}

Mutations

14

1.1
Location : getJobName
Killed by : edu.ucsb.cs156.jobs.services.JobContextConsumerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.services.JobContextConsumerTests]/[method:defaults_jobName_to_simple_class_name_and_scope_to_null()]
replaced return value with "" for edu/ucsb/cs156/jobs/services/JobContextConsumer::getJobName → KILLED

22

1.1
Location : getScopeType
Killed by : edu.ucsb.cs156.jobs.services.JobContextConsumerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.services.JobContextConsumerTests]/[method:defaults_jobName_to_simple_class_name_and_scope_to_null()]
replaced return value with "" for edu/ucsb/cs156/jobs/services/JobContextConsumer::getScopeType → KILLED

27

1.1
Location : getScopeId
Killed by : edu.ucsb.cs156.jobs.services.JobContextConsumerTests.[engine:junit-jupiter]/[class:edu.ucsb.cs156.jobs.services.JobContextConsumerTests]/[method:defaults_jobName_to_simple_class_name_and_scope_to_null()]
replaced Long return value with 0L for edu/ucsb/cs156/jobs/services/JobContextConsumer::getScopeId → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0