LockState.java

1
package org.sanmibuh.tedee.lock.domain.vo;
2
3
import org.sanmibuh.tedee.lock.domain.exception.InvalidLockStateException;
4
5
public enum LockState {
6
  UNCALIBRATED(0),
7
  CALIBRATION(1),
8
  OPEN(2),
9
  PARTIALLY_OPEN(3),
10
  OPENING(4),
11
  CLOSING(5),
12
  CLOSED(6),
13
  PULL_SPRING(7),
14
  PULLING(8),
15
  UNKNOWN(9),
16
  UNPULLING(255);
17
18
  private final int bridgeCode;
19
20
  LockState(final int bridgeCode) {
21
    this.bridgeCode = bridgeCode;
22
  }
23
24
  public static LockState fromBridgeCode(final int bridgeCode) {
25
    for (final var state : values()) {
26 1 1. fromBridgeCode : negated conditional → KILLED
      if (state.bridgeCode == bridgeCode) {
27 1 1. fromBridgeCode : replaced return value with null for org/sanmibuh/tedee/lock/domain/vo/LockState::fromBridgeCode → KILLED
        return state;
28
      }
29
    }
30
    throw new InvalidLockStateException(bridgeCode);
31
  }
32
}

Mutations

26

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]
negated conditional → KILLED

27

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/LockState::fromBridgeCode → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.0 support