HiveStateMachineService.kt

1
package io.github.Michal_Antosiewicz.apiary_management_system.service
2
3
import io.github.Michal_Antosiewicz.apiary_management_system.domain.*
4
import io.github.Michal_Antosiewicz.apiary_management_system.event.*
5
import io.github.Michal_Antosiewicz.apiary_management_system.repository.DecisionAlertRepository
6
import io.github.Michal_Antosiewicz.apiary_management_system.repository.HiveRepository
7
import io.github.Michal_Antosiewicz.apiary_management_system.repository.HiveStateTransitionRepository
8
import io.github.Michal_Antosiewicz.apiary_management_system.repository.TreatmentRepository
9
import org.springframework.context.event.EventListener
10
import org.springframework.core.annotation.Order
11
import org.springframework.stereotype.Service
12
import org.springframework.transaction.annotation.Transactional
13
import java.math.BigDecimal
14
import java.time.Instant
15
import io.github.Michal_Antosiewicz.apiary_management_system.repository.HarvestDecisionRepository
16
17
@Service
18
class HiveStateMachineService(
19
    private val hiveRepository: HiveRepository,
20
    private val treatmentRepository: TreatmentRepository,
21
    private val transitionRepository: HiveStateTransitionRepository,
22
    private val alertRepository: DecisionAlertRepository,
23
    private val decisionRepository: HarvestDecisionRepository
24
) {
25
26
    // Handles biological and operational state transitions triggered by field inspection data
27
    @EventListener
28
    @Transactional
29
    fun onInspectionRecorded(event: InspectionRecordedEvent) {
30 1 1. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
        val hive = hiveRepository.findById(event.hiveId).orElse(null) ?: return
31 2 1. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
2. onInspectionRecorded : removed conditional - replaced equality check with false → KILLED
        require(hive.operationalState != OperationalState.DECOMMISSIONED) { "Cannot inspect a decommissioned hive" }
32
        val currentBioState = hive.biologicalState
33
34
        val targetBioState = when {
35
            // Swarm preparation trigger: marginal cells present
36 3 1. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
2. onInspectionRecorded : changed conditional boundary → NO_COVERAGE
3. onInspectionRecorded : removed conditional - replaced comparison check with false → NO_COVERAGE
            event.queenCellsPlacement == CellPlacement.MARGINAL && event.queenCellsCount > 0 ->
37
                BiologicalState.SWARM_PREPARATION
38
39
            // Supersedure trigger: central cells with low quantity
40 6 1. onInspectionRecorded : changed conditional boundary → NO_COVERAGE
2. onInspectionRecorded : changed conditional boundary → NO_COVERAGE
3. onInspectionRecorded : removed conditional - replaced equality check with false → NO_COVERAGE
4. onInspectionRecorded : removed conditional - replaced comparison check with false → NO_COVERAGE
5. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
6. onInspectionRecorded : removed conditional - replaced comparison check with false → NO_COVERAGE
            event.queenCellsPlacement == CellPlacement.CENTRAL && event.queenCellsCount in 1..4 ->
41
                BiologicalState.SUPERSEDURE_ACTIVE
42
43
            // Absconding risk trigger: extreme parasite load or complete starvation
44 5 1. onInspectionRecorded : changed conditional boundary → SURVIVED
2. onInspectionRecorded : removed conditional - replaced comparison check with false → SURVIVED
3. onInspectionRecorded : removed conditional - replaced comparison check with false → SURVIVED
4. onInspectionRecorded : removed conditional - replaced equality check with false → NO_COVERAGE
5. onInspectionRecorded : changed conditional boundary → SURVIVED
            event.varroaMiteCount >= 25 || (event.honeyStoresKg < BigDecimal("1.50") && event.signsOfPests) ->
45
                BiologicalState.ABSCONDING_RISK
46
47
            // Congestion precursor
48 3 1. onInspectionRecorded : removed conditional - replaced equality check with false → NO_COVERAGE
2. onInspectionRecorded : removed conditional - replaced comparison check with false → SURVIVED
3. onInspectionRecorded : changed conditional boundary → SURVIVED
            event.freeCombSpacePercent <= BigDecimal("10.0") && currentBioState == BiologicalState.NOMINAL ->
49
                BiologicalState.CONGESTED
50
51
            // Stress and absconding recovery when parasite and store indicators normalize
52 1 1. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
            currentBioState == BiologicalState.ABSCONDING_RISK &&
53 2 1. onInspectionRecorded : changed conditional boundary → NO_COVERAGE
2. onInspectionRecorded : removed conditional - replaced comparison check with false → NO_COVERAGE
                    event.varroaMiteCount < 10 &&
54 2 1. onInspectionRecorded : removed conditional - replaced comparison check with false → NO_COVERAGE
2. onInspectionRecorded : changed conditional boundary → NO_COVERAGE
                    event.honeyStoresKg >= BigDecimal("3.00") &&
55 1 1. onInspectionRecorded : removed conditional - replaced equality check with false → NO_COVERAGE
                    !event.signsOfPests ->
56
                BiologicalState.NOMINAL
57
58
            // Congestion recovery; SWARM_PREPARATION resolves only via swarm intervention
59 1 1. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
            currentBioState == BiologicalState.CONGESTED &&
60 3 1. onInspectionRecorded : changed conditional boundary → NO_COVERAGE
2. onInspectionRecorded : removed conditional - replaced equality check with false → NO_COVERAGE
3. onInspectionRecorded : removed conditional - replaced comparison check with false → NO_COVERAGE
                    event.queenCellsCount == 0 && event.freeCombSpacePercent > BigDecimal("20.0") ->
61
                BiologicalState.NOMINAL
62
63
            else -> currentBioState
64
        }
65
66 1 1. onInspectionRecorded : removed conditional - replaced equality check with false → SURVIVED
        if (currentBioState != targetBioState) {
67 1 1. onInspectionRecorded : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → NO_COVERAGE
            recordTransition(
68
                hive = hive,
69
                fsmType = "BIOLOGICAL_DYNAMICS",
70
                fromState = currentBioState.name,
71
                toState = targetBioState.name,
72
                event = event,
73
                reason = "Automated biological state transition based on inspection indicators"
74
            )
75 1 1. onInspectionRecorded : removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setBiologicalState → NO_COVERAGE
            hive.biologicalState = targetBioState
76
            hiveRepository.save(hive)
77
        }
78
79 1 1. onInspectionRecorded : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::evaluateOperationalStateOnInspection → KILLED
        evaluateOperationalStateOnInspection(hive, event)
80
    }
81
82
    // Handles operational state transition when veterinary treatment is initiated
83
    @EventListener
84
    @Transactional
85
    fun onTreatmentApplied(event: TreatmentAppliedEvent) {
86 1 1. onTreatmentApplied : removed conditional - replaced equality check with false → SURVIVED
        val hive = hiveRepository.findById(event.hiveId).orElse(null) ?: return
87 2 1. onTreatmentApplied : removed conditional - replaced equality check with false → SURVIVED
2. onTreatmentApplied : removed conditional - replaced equality check with false → KILLED
        require(hive.operationalState != OperationalState.DECOMMISSIONED) { "Cannot treat a decommissioned hive" }
88
        val previousState = hive.operationalState
89 1 1. onTreatmentApplied : removed conditional - replaced equality check with false → KILLED
        val nextState = if (previousState == OperationalState.WINTERING) previousState else OperationalState.TREATMENT_IN_PROGRESS
90
91 1 1. onTreatmentApplied : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → KILLED
        recordTransition(
92
            hive = hive,
93
            fsmType = "OPERATIONAL_LIFECYCLE",
94
            fromState = previousState.name,
95
            toState = nextState.name,
96
            event = event,
97
            reason = "Administered ${event.medicineName}; withdrawal period set until ${event.withdrawalEndDate}"
98
        )
99
100 1 1. onTreatmentApplied : removed conditional - replaced equality check with false → KILLED
        if (nextState != previousState) {
101 1 1. onTreatmentApplied : removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setOperationalState → KILLED
            hive.operationalState = nextState
102
            hiveRepository.save(hive)
103
        }
104
    }
105
106
    // A business rejection is a persisted result, never an exception that rolls back its own audit.
107
    @EventListener
108
    @Order(0)
109
    @Transactional
110
    fun onHoneyHarvestAttempted(event: HoneyHarvestAttemptedEvent) {
111 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
        if (decisionRepository.existsById(event.eventId)) return
112 1 1. onHoneyHarvestAttempted$lambda$2 : replaced return value with null for io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::onHoneyHarvestAttempted$lambda$2 → NO_COVERAGE
        val hive = hiveRepository.findById(event.hiveId).orElseThrow { IllegalArgumentException("Hive not found") }
113
        val unavailable = hive.operationalState in setOf(OperationalState.DECOMMISSIONED, OperationalState.WINTERING)
114
        val active = treatmentRepository.findActiveTreatmentsByHiveId(hive.id, event.occurredAt)
115
        val conflict = active.maxByOrNull { it.withdrawalEndDate }
116 2 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
2. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
        val approved = !unavailable && conflict == null
117
        val reason = when {
118 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
            unavailable -> "OPERATIONAL_STATE_BLOCKED"
119 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
            conflict != null -> "ACTIVE_WITHDRAWAL"
120
            else -> "SANITARY_GUARD_CLEARED"
121
        }
122
        val message = when {
123 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
            unavailable -> "Harvest rejected in operational state ${hive.operationalState}"
124 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
            conflict != null -> "Harvest rejected: ${conflict.medicineName} restriction lasts until ${conflict.withdrawalEndDate}"
125
            else -> "No recorded treatment restriction is active; harvest permitted"
126
        }
127 2 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
2. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
        if (conflict != null && !unavailable) {
128 1 1. onHoneyHarvestAttempted : removed call to kotlin/jvm/internal/Intrinsics::checkNotNull → SURVIVED
            alertRepository.save(DecisionAlert(hive = hive, alertType = AlertType.SANITARY_VIOLATION,
129
                severity = AlertSeverity.CRITICAL, riskScore = BigDecimal("1.000"),
130
                recommendationText = message, eventId = event.eventId, createdAt = event.occurredAt))
131
        }
132 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
        val target = if (approved) OperationalState.ACTIVE_HONEY_FLOW else hive.operationalState
133 2 1. onHoneyHarvestAttempted : removed call to kotlin/jvm/internal/Intrinsics::checkNotNull → SURVIVED
2. onHoneyHarvestAttempted : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → KILLED
        recordTransition(hive, "OPERATIONAL_LIFECYCLE", hive.operationalState.name, target.name,
134 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
            event, "${if (approved) "APPROVED" else "REJECTED"}: $reason; $message")
135 1 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
        if (hive.operationalState != target) {
136 1 1. onHoneyHarvestAttempted : removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setOperationalState → KILLED
            hive.operationalState = target
137
            hiveRepository.save(hive)
138
        }
139
        decisionRepository.save(HarvestDecision(event.eventId, hive, approved, reason, message,
140 2 1. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
2. onHoneyHarvestAttempted : removed conditional - replaced equality check with false → KILLED
            event.occurredAt, if (!unavailable) conflict?.withdrawalEndDate else null))
141
    }
142
143
    // Resolves swarm preparation state following successful beekeeper intervention
144
    @EventListener
145
    @Transactional
146
    fun onSwarmInterventionApplied(event: SwarmInterventionAppliedEvent) {
147 1 1. onSwarmInterventionApplied : removed conditional - replaced equality check with false → NO_COVERAGE
        val hive = hiveRepository.findById(event.hiveId).orElse(null) ?: return
148
149 1 1. onSwarmInterventionApplied : removed conditional - replaced equality check with false → NO_COVERAGE
        if (hive.operationalState != OperationalState.DECOMMISSIONED &&
150 1 1. onSwarmInterventionApplied : removed conditional - replaced equality check with false → NO_COVERAGE
            hive.biologicalState == BiologicalState.SWARM_PREPARATION &&
151 2 1. onSwarmInterventionApplied : removed conditional - replaced equality check with false → NO_COVERAGE
2. onSwarmInterventionApplied : removed conditional - replaced equality check with false → NO_COVERAGE
            (event.artificialSwarmCreated || event.queenCellsDestroyed)) {
152 1 1. onSwarmInterventionApplied : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → NO_COVERAGE
            recordTransition(
153
                hive = hive,
154
                fsmType = "BIOLOGICAL_DYNAMICS",
155
                fromState = hive.biologicalState.name,
156
                toState = BiologicalState.NOMINAL.name,
157
                event = event,
158
                reason = "Swarm intervention applied (${event.interventionType}); state reset to nominal"
159
            )
160 1 1. onSwarmInterventionApplied : removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setBiologicalState → NO_COVERAGE
            hive.biologicalState = BiologicalState.NOMINAL
161
            hiveRepository.save(hive)
162
        }
163
    }
164
165
    // Concludes supersedure cycle upon verified queen replacement
166
    @EventListener
167
    @Transactional
168
    fun onQueenReplaced(event: QueenReplacedEvent) {
169 1 1. onQueenReplaced : removed conditional - replaced equality check with false → NO_COVERAGE
        val hive = hiveRepository.findById(event.hiveId).orElse(null) ?: return
170
171 2 1. onQueenReplaced : removed conditional - replaced equality check with false → NO_COVERAGE
2. onQueenReplaced : removed conditional - replaced equality check with false → NO_COVERAGE
        if (hive.operationalState != OperationalState.DECOMMISSIONED && hive.biologicalState == BiologicalState.SUPERSEDURE_ACTIVE) {
172 1 1. onQueenReplaced : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → NO_COVERAGE
            recordTransition(
173
                hive = hive,
174
                fsmType = "BIOLOGICAL_DYNAMICS",
175
                fromState = hive.biologicalState.name,
176
                toState = BiologicalState.NOMINAL.name,
177
                event = event,
178
                reason = "New queen installed (${event.breedLine}); supersedure cycle concluded"
179
            )
180 1 1. onQueenReplaced : removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setBiologicalState → NO_COVERAGE
            hive.biologicalState = BiologicalState.NOMINAL
181
            hiveRepository.save(hive)
182
        }
183
    }
184
185
    private fun evaluateOperationalStateOnInspection(hive: Hive, event: InspectionRecordedEvent) {
186 2 1. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
2. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
        if (hive.operationalState == OperationalState.DECOMMISSIONED || hive.operationalState == OperationalState.WINTERING) return
187
        val active = treatmentRepository.findActiveTreatmentsByHiveId(hive.id, event.occurredAt)
188
        val target = when {
189 1 1. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
            active.any { event.occurredAt.isBefore(it.treatmentEndDate) } -> OperationalState.TREATMENT_IN_PROGRESS
190 2 1. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
2. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
            active.isNotEmpty() -> OperationalState.WITHDRAWAL
191 1 1. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
            hive.operationalState in setOf(OperationalState.TREATMENT_IN_PROGRESS, OperationalState.WITHDRAWAL) -> OperationalState.PREPARATION
192
            else -> hive.operationalState
193
        }
194 1 1. evaluateOperationalStateOnInspection : removed conditional - replaced equality check with false → KILLED
        if (target != hive.operationalState) {
195 1 1. evaluateOperationalStateOnInspection : removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → KILLED
            recordTransition(hive, "OPERATIONAL_LIFECYCLE", hive.operationalState.name, target.name,
196
                event, "Treatment status reconciled at event time ${event.occurredAt}")
197 1 1. evaluateOperationalStateOnInspection : removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setOperationalState → KILLED
            hive.operationalState = target
198
            hiveRepository.save(hive)
199
        }
200
    }
201
202
    private fun recordTransition(
203
        hive: Hive,
204
        fsmType: String,
205
        fromState: String,
206
        toState: String,
207
        event: ApiaryDomainEvent,
208
        reason: String
209
    ) {
210
        transitionRepository.save(
211
            HiveStateTransition(
212
                hive = hive,
213
                fsmType = fsmType,
214
                fromState = fromState,
215
                toState = toState,
216
                triggerEvent = "${event::class.simpleName}:${event.eventId}",
217
                reason = reason,
218
                transitionTimestamp = event.occurredAt,
219
                eventId = event.eventId
220
            )
221
        )
222
    }
223
}

Mutations

30

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

31

1.1
Location : onInspectionRecorded
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#65]
removed conditional - replaced equality check with false → KILLED

2.2
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

36

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

2.2
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

40

1.1
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

4.4
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

5.5
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

6.6
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

44

1.1
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

2.2
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → SURVIVED Covering tests

3.3
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → SURVIVED Covering tests

4.4
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

5.5
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → SURVIVED Covering tests

48

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → SURVIVED
Covering tests

3.3
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → SURVIVED Covering tests

52

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

53

1.1
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

54

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

2.2
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → NO_COVERAGE

55

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

59

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

60

1.1
Location : onInspectionRecorded
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced comparison check with false → NO_COVERAGE

66

1.1
Location : onInspectionRecorded
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

67

1.1
Location : onInspectionRecorded
Killed by : none
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → NO_COVERAGE

75

1.1
Location : onInspectionRecorded
Killed by : none
removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setBiologicalState → NO_COVERAGE

79

1.1
Location : onInspectionRecorded
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#47]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::evaluateOperationalStateOnInspection → KILLED

86

1.1
Location : onTreatmentApplied
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

87

1.1
Location : onTreatmentApplied
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

2.2
Location : onTreatmentApplied
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#63]
removed conditional - replaced equality check with false → KILLED

89

1.1
Location : onTreatmentApplied
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#63]
removed conditional - replaced equality check with false → KILLED

91

1.1
Location : onTreatmentApplied
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:winteringPersistsAcrossTreatmentAndHarvest(int, boolean, long)]/[test-template-invocation:#3]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → KILLED

100

1.1
Location : onTreatmentApplied
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#51]
removed conditional - replaced equality check with false → KILLED

101

1.1
Location : onTreatmentApplied
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#51]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setOperationalState → KILLED

111

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[method:rejectionAuditRemainsCommittedAfterHttp409()]
removed conditional - replaced equality check with false → KILLED

112

1.1
Location : onHoneyHarvestAttempted$lambda$2
Killed by : none
replaced return value with null for io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::onHoneyHarvestAttempted$lambda$2 → NO_COVERAGE

116

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#55]
removed conditional - replaced equality check with false → KILLED

2.2
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#55]
removed conditional - replaced equality check with false → KILLED

118

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#79]
removed conditional - replaced equality check with false → KILLED

119

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#52]
removed conditional - replaced equality check with false → KILLED

123

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#79]
removed conditional - replaced equality check with false → KILLED

124

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#52]
removed conditional - replaced equality check with false → KILLED

127

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#52]
removed conditional - replaced equality check with false → KILLED

2.2
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#52]
removed conditional - replaced equality check with false → KILLED

128

1.1
Location : onHoneyHarvestAttempted
Killed by : none
removed call to kotlin/jvm/internal/Intrinsics::checkNotNull → SURVIVED
Covering tests

132

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#55]
removed conditional - replaced equality check with false → KILLED

133

1.1
Location : onHoneyHarvestAttempted
Killed by : none
removed call to kotlin/jvm/internal/Intrinsics::checkNotNull → SURVIVED
Covering tests

2.2
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#79]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → KILLED

134

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#55]
removed conditional - replaced equality check with false → KILLED

135

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#55]
removed conditional - replaced equality check with false → KILLED

136

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#55]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setOperationalState → KILLED

140

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#52]
removed conditional - replaced equality check with false → KILLED

2.2
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#52]
removed conditional - replaced equality check with false → KILLED

147

1.1
Location : onSwarmInterventionApplied
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

149

1.1
Location : onSwarmInterventionApplied
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

150

1.1
Location : onSwarmInterventionApplied
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

151

1.1
Location : onSwarmInterventionApplied
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : onSwarmInterventionApplied
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

152

1.1
Location : onSwarmInterventionApplied
Killed by : none
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → NO_COVERAGE

160

1.1
Location : onSwarmInterventionApplied
Killed by : none
removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setBiologicalState → NO_COVERAGE

169

1.1
Location : onQueenReplaced
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

171

1.1
Location : onQueenReplaced
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : onQueenReplaced
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

172

1.1
Location : onQueenReplaced
Killed by : none
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → NO_COVERAGE

180

1.1
Location : onQueenReplaced
Killed by : none
removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setBiologicalState → NO_COVERAGE

186

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#65]
removed conditional - replaced equality check with false → KILLED

2.2
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#47]
removed conditional - replaced equality check with false → KILLED

189

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#44]
removed conditional - replaced equality check with false → KILLED

190

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#53]
removed conditional - replaced equality check with false → KILLED

2.2
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#53]
removed conditional - replaced equality check with false → KILLED

191

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#47]
removed conditional - replaced equality check with false → KILLED

194

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#47]
removed conditional - replaced equality check with false → KILLED

195

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#47]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/service/HiveStateMachineService::recordTransition → KILLED

197

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#47]
removed call to io/github/Michal_Antosiewicz/apiary_management_system/domain/Hive::setOperationalState → KILLED

227

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#85]
removed conditional - replaced equality check with false → KILLED

229

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#79]
removed conditional - replaced equality check with false → KILLED

234

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#28]
removed conditional - replaced comparison check with false → KILLED

2.2
Location : onHoneyHarvestAttempted
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

238

1.1
Location : onHoneyHarvestAttempted
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#88]
removed conditional - replaced equality check with false → KILLED

240

1.1
Location : evaluateOperationalStateOnInspection
Killed by : none
removed conditional - replaced equality check with false → SURVIVED
Covering tests

2.2
Location : evaluateOperationalStateOnInspection
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

241

1.1
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#44]
removed conditional - replaced equality check with false → KILLED

2.2
Location : evaluateOperationalStateOnInspection
Killed by : io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest.[engine:junit-jupiter]/[class:io.github.Michal_Antosiewicz.apiary_management_system.WorkflowIntegrationTest]/[test-template:operationalConformance(io.github.Michal_Antosiewicz.apiary_management_system.domain.OperationalState, java.lang.String, java.lang.String)]/[test-template-invocation:#44]
removed conditional - replaced equality check with false → KILLED

Active mutators

Tests examined


Report generated by PIT 1.30.2 support