add unit tests

This commit is contained in:
Rodica Sutu
2019-11-04 11:39:35 +02:00
parent c33e703be9
commit 671d6b954c
2 changed files with 34 additions and 3 deletions

View File

@@ -236,4 +236,26 @@ public class PropertyModificationAllowedCheckUnitTest
after.put(qName, null);
assertTrue(propertyModificationAllowedCheck.check(before, after));
}
/**
* Test update of a property from the model URI for which properties can be updated
*/
@Test
public void testUpdatePropertyFromAllowedModelURI()
{
editableURIs.add("foo");
propertyModificationAllowedCheck.setEditableURIs(editableURIs);
assertTrue(propertyModificationAllowedCheck.check(before, after));
}
/**
* Test update of a property that is not in the model URI for which properties can be updated
*/
@Test
public void testUpdatePropertyFromNotAllowedModelURI()
{
editableURIs.add("bar");
propertyModificationAllowedCheck.setEditableURIs(editableURIs);
assertFalse(propertyModificationAllowedCheck.check(before, after));
}
}