use of org.assertj.core.api.SoftAssertions in project drools by kiegroup.
the class EventFactHandleDeserializationTest method testDisconnectedEventFactHandle.
@Test
public void testDisconnectedEventFactHandle() {
// DROOLS-924
final String drl = "declare String \n" + " @role(event)\n" + "end\n";
final KieSession ksession = new KieHelper().addContent(drl, ResourceType.DRL).build().newKieSession();
final DefaultFactHandle helloHandle = (DefaultFactHandle) ksession.insert("hello");
final DefaultFactHandle goodbyeHandle = (DefaultFactHandle) ksession.insert("goodbye");
final SoftAssertions softly = new SoftAssertions();
FactHandle key = DefaultFactHandle.createFromExternalFormat(helloHandle.toExternalForm());
softly.assertThat(key).isInstanceOf(EventFactHandle.class);
softly.assertThat(ksession.getObject(key)).isEqualTo("hello");
key = DefaultFactHandle.createFromExternalFormat(goodbyeHandle.toExternalForm());
softly.assertThat(key).isInstanceOf(EventFactHandle.class);
softly.assertThat(ksession.getObject(key)).isEqualTo("goodbye");
softly.assertAll();
}
Aggregations