@Test
public void testExtraProperties() {

    final Map<String, PropertyDescriptor> descriptors = new HashMap<>();
    final VersionedProcessGroup flow = new VersionedProcessGroup();
    final Map<String, String> properties = new HashMap<>();
    properties.put("Extra Property", "Extra Value");
    final ControllerServiceLookup serviceLookup = Mockito.mock(ControllerServiceLookup.class);
    final PropertyValidationContext dynamicNotAllowed = new PropertyValidationContext(descriptors, false);
    Collection<String> validationErrors = dynamicNotAllowed.validateProperties(properties, flow, "flow-a", serviceLookup);
    assertEquals(1, validationErrors.size());
    final PropertyValidationContext dynamicAllowed = new PropertyValidationContext(descriptors, true);
    validationErrors = dynamicAllowed.validateProperties(properties, flow,"flow-a", serviceLookup);
    assertTrue(validationErrors.isEmpty());
}