diff --git a/source/java/org/alfresco/repo/node/integrity/PropertiesIntegrityEvent.java b/source/java/org/alfresco/repo/node/integrity/PropertiesIntegrityEvent.java index fd68fa7077..c1f78dfffa 100644 --- a/source/java/org/alfresco/repo/node/integrity/PropertiesIntegrityEvent.java +++ b/source/java/org/alfresco/repo/node/integrity/PropertiesIntegrityEvent.java @@ -151,7 +151,7 @@ public class PropertiesIntegrityEvent extends AbstractIntegrityEvent { QName propertyQName = propertyDef.getName(); // check that enforced, mandatoryproperties are set - if (propertyDef.isMandatory() && propertyDef.isMandatoryEnforced() && !nodeProperties.containsKey(propertyQName)) + if (propertyDef.isMandatory() && propertyDef.isMandatoryEnforced() && (!nodeProperties.containsKey(propertyQName) || null == nodeProperties.get(propertyQName))) { String nameProp = (String) nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); IntegrityRecord result = new IntegrityRecord( diff --git a/source/test-java/org/alfresco/repo/node/integrity/IntegrityTest.java b/source/test-java/org/alfresco/repo/node/integrity/IntegrityTest.java index 00065bd8fc..e69ca22974 100644 --- a/source/test-java/org/alfresco/repo/node/integrity/IntegrityTest.java +++ b/source/test-java/org/alfresco/repo/node/integrity/IntegrityTest.java @@ -245,6 +245,13 @@ public class IntegrityTest extends TestCase checkIntegrityNoFailure(); } + public void testCreateWithNullMandatoryProperty() throws Exception + { + allProperties.put(TEST_PROP_TEXT_A, null); + NodeRef nodeRef = createNode("abc", TEST_TYPE_WITH_PROPERTIES, allProperties); + checkIntegrityExpectFailure("Failed to detect null mandatory properties", 1); + } + public void testCreateWithEmptyMandatoryProperty() throws Exception { allProperties.put(TEST_PROP_TEXT_A, "");