LockJamStatus.java

1
package org.sanmibuh.tedee.lock.domain.vo;
2
3
import org.sanmibuh.tedee.lock.domain.exception.InvalidLockJamStatusException;
4
5
public enum LockJamStatus {
6
  NOT_JAMMED(0),
7
  JAMMED(1);
8
9
  private final int bridgeCode;
10
11
  LockJamStatus(final int bridgeCode) {
12
    this.bridgeCode = bridgeCode;
13
  }
14
15
  public static LockJamStatus fromBridgeCode(final int bridgeCode) {
16
    for (final var status : values()) {
17 1 1. fromBridgeCode : negated conditional → KILLED
      if (status.bridgeCode == bridgeCode) {
18 1 1. fromBridgeCode : replaced return value with null for org/sanmibuh/tedee/lock/domain/vo/LockJamStatus::fromBridgeCode → KILLED
        return status;
19
      }
20
    }
21
    throw new InvalidLockJamStatusException(bridgeCode);
22
  }
23
}

Mutations

17

1.1
Location : fromBridgeCode
Killed by : org.sanmibuh.tedee.lock.application.ReportLockStatusHandlerTest.[engine:junit-jupiter]/[class:org.sanmibuh.tedee.lock.application.ReportLockStatusHandlerTest]/[method:should_throwException_whenReportingUndocumentedJamStatus()]
negated conditional → KILLED

18

1.1
Location : fromBridgeCode
Killed by : org.sanmibuh.tedee.lock.application.ReportLockStatusHandlerTest.[engine:junit-jupiter]/[class:org.sanmibuh.tedee.lock.application.ReportLockStatusHandlerTest]/[test-template:should_recordLockStatusReported_whenReportingJammedState(int)]/[test-template-invocation:#2]
replaced return value with null for org/sanmibuh/tedee/lock/domain/vo/LockJamStatus::fromBridgeCode → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.0 support