ReportLockStatusHandler.java

1
package org.sanmibuh.tedee.lock.application;
2
3
import lombok.RequiredArgsConstructor;
4
import org.sanmibuh.ddd.port.CommandHandler;
5
import org.sanmibuh.tedee.lock.domain.Lock;
6
import org.sanmibuh.tedee.lock.domain.LockRepository;
7
import org.sanmibuh.tedee.lock.domain.vo.LockId;
8
import org.sanmibuh.tedee.lock.domain.vo.LockJamStatus;
9
import org.sanmibuh.tedee.lock.domain.vo.LockState;
10
11
@RequiredArgsConstructor
12
public final class ReportLockStatusHandler extends CommandHandler<ReportLockStatusCommand, Lock> {
13
14
  private final LockRepository repository;
15
16
  @Override
17
  protected Lock execute(final ReportLockStatusCommand command) {
18
    final var lock = repository.get(new LockId(command.deviceId()));
19 1 1. execute : removed call to org/sanmibuh/tedee/lock/domain/Lock::reportStatus → KILLED
    lock.reportStatus(
20
        LockState.fromBridgeCode(command.state()), LockJamStatus.fromBridgeCode(command.jammed()));
21 1 1. execute : removed call to org/sanmibuh/tedee/lock/domain/LockRepository::save → KILLED
    repository.save(lock);
22
23 1 1. execute : replaced return value with null for org/sanmibuh/tedee/lock/application/ReportLockStatusHandler::execute → KILLED
    return lock;
24
  }
25
}

Mutations

19

1.1
Location : execute
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]
removed call to org/sanmibuh/tedee/lock/domain/Lock::reportStatus → KILLED

21

1.1
Location : execute
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]
removed call to org/sanmibuh/tedee/lock/domain/LockRepository::save → KILLED

23

1.1
Location : execute
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/application/ReportLockStatusHandler::execute → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.0 support