From 0feb72018d7a70b10487dff465987a2d2e927226 Mon Sep 17 00:00:00 2001 From: nprentza Date: Tue, 11 Jul 2023 12:35:33 +0300 Subject: [PATCH] fail test if Optional FactHandle is empty --- .../infinispan/ReliabilityUpdateInDrlTest.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drools-reliability/drools-reliability-infinispan/src/test/java/org/drools/reliability/infinispan/ReliabilityUpdateInDrlTest.java b/drools-reliability/drools-reliability-infinispan/src/test/java/org/drools/reliability/infinispan/ReliabilityUpdateInDrlTest.java index 6ca6a1f22dc..80da2b4ce80 100644 --- a/drools-reliability/drools-reliability-infinispan/src/test/java/org/drools/reliability/infinispan/ReliabilityUpdateInDrlTest.java +++ b/drools-reliability/drools-reliability-infinispan/src/test/java/org/drools/reliability/infinispan/ReliabilityUpdateInDrlTest.java @@ -124,9 +124,8 @@ void insertFailoverDeleteFailoverInsert_shouldRecoverAndMatchRules(PersistedSess clearResults(); Optional getFactHandleForPerson = getFactHandle(pEleven); - if (!getFactHandleForPerson.isEmpty()){ - delete(getFactHandleForPerson.get()); - } + assertThat(getFactHandleForPerson.isEmpty()).isFalse(); + delete(getFactHandleForPerson.get()); failover(); @@ -238,9 +237,8 @@ void multiplKieSession_insertFailoverDeleteFailoverInsert_shouldRecoverAndMatchR clearResults(session2); Optional getFactHandleForPerson = getFactHandle(session2, pEleven); - if (!getFactHandleForPerson.isEmpty()){ - delete(session2, getFactHandleForPerson.get()); - } + assertThat(getFactHandleForPerson.isEmpty()).isFalse(); + delete(session2, getFactHandleForPerson.get()); failover();