}
}
private void testCallbacks(final SecurityContext securityContext) throws FrameworkException {
TestFive entity = null;
Integer zero = 0;
Integer one = 1;
try (final Tx tx = app.tx()) {
entity = app.create(TestFive.class);
tx.success();
} catch (Throwable t) {
t.printStackTrace();
}
assertNotNull("Entity should have been created", entity);
// creation assertions
try (final Tx tx = app.tx()) {
assertEquals("modifiedInBeforeCreation should have a value of 1: ", one, entity.getProperty(TestFive.modifiedInBeforeCreation));
assertEquals("modifiedInAfterCreation should have a value of 1: ", one, entity.getProperty(TestFive.modifiedInAfterCreation));
// modification assertions
assertEquals("modifiedInBeforeModification should have a value of 0: ", zero, entity.getProperty(TestFive.modifiedInBeforeModification));
assertEquals("modifiedInAfterModification should have a value of 0: ", zero, entity.getProperty(TestFive.modifiedInAfterModification));
}
// 2nd part of the test: modify node
try (final Tx tx = app.tx()) {
final TestFive finalEntity = entity;
finalEntity.setProperty(TestFive.intProperty, 123);
tx.success();
} catch (Throwable t) {
t.printStackTrace();
}