Skip to content
Snippets Groups Projects
Verified Commit 23d787e8 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

TEST: Unit test to guard against the server not updating list props.

This is an additional safeguard against issue #217, in addition to the existing Python integration
test.
parent 2cf7e0e5
No related branches found
No related tags found
2 merge requests!58REL: prepare release 0.7.2,!55Re-Merge branch 'f-state-change' into 'dev'
Pipeline #19999 passed
...@@ -256,4 +256,36 @@ public class UpdateTest { ...@@ -256,4 +256,36 @@ public class UpdateTest {
assertEquals(newEntity.getEntityStatus(), QUALIFIED); assertEquals(newEntity.getEntityStatus(), QUALIFIED);
assertEquals(newProperty.getEntityStatus(), QUALIFIED); assertEquals(newProperty.getEntityStatus(), QUALIFIED);
} }
/**
* For issue #217: Server gets list property datatype wrong if description is updated.
*/
@Test
public void testDeriveUpdate_UpdateList()
throws NoSuchAlgorithmException, CaosDBException, IOException {
final Property oldProperty = new Property(1);
final Property newProperty = new Property(1);
oldProperty.setDatatype("List<Person>");
newProperty.setDatatype("List<Person>");
final Entity oldEntity = new Entity();
final Entity newEntity = new Entity();
oldProperty.setRole("Record");
newProperty.setRole("Property");
oldEntity.addProperty(oldProperty);
newEntity.addProperty(newProperty);
// The only difference between old and new
newEntity.setDescription("New description.");
new WriteTransaction(null).deriveUpdate(newEntity, oldEntity);
// check if newEntity's Property is QUALIFIED.
assertEquals(QUALIFIED, newEntity.getProperties().get(0).getEntityStatus());
// CheckPropValid checkJob = new CheckPropValid();
// checkJob.init(null, newEntity, null);
// checkJob.run();
// assertTrue(newEntity.getProperties().get(0).isDatatypeOverride());
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment