mirror of https://github.com/apache/nifi.git
NIFI-12531 Parameter references are removed after property migration
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #8176.
This commit is contained in:
parent
76f880588f
commit
1a34208f65
|
@ -2110,7 +2110,7 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||
final List<ControllerServiceCreationDetails> servicesCreated = propertyConfig.getCreatedServices();
|
||||
servicesCreated.forEach(serviceFactory::create);
|
||||
|
||||
overwriteProperties(propertyConfig.getProperties());
|
||||
overwriteProperties(propertyConfig.getRawProperties());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -452,7 +452,7 @@ public abstract class AbstractReportingTaskNode extends AbstractComponentNode im
|
|||
final List<ControllerServiceCreationDetails> servicesCreated = propertyConfig.getCreatedServices();
|
||||
servicesCreated.forEach(serviceFactory::create);
|
||||
|
||||
overwriteProperties(propertyConfig.getProperties());
|
||||
overwriteProperties(propertyConfig.getRawProperties());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -858,7 +858,7 @@ public class StandardControllerServiceNode extends AbstractComponentNode impleme
|
|||
final List<ControllerServiceCreationDetails> servicesCreated = propertyConfig.getCreatedServices();
|
||||
servicesCreated.forEach(serviceFactory::create);
|
||||
|
||||
overwriteProperties(propertyConfig.getProperties());
|
||||
overwriteProperties(propertyConfig.getRawProperties());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,11 @@ public class StandardPropertyConfiguration implements PropertyConfiguration {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (Objects.equals(propertyName, newName)) {
|
||||
logger.debug("Will not update property [{}] for [{}] because the new name and the current name are the same", propertyName, componentDescription);
|
||||
return false;
|
||||
}
|
||||
|
||||
final String effectivePropertyValue = effectiveProperties.remove(propertyName);
|
||||
effectiveProperties.put(newName, effectivePropertyValue);
|
||||
|
||||
|
|
|
@ -107,6 +107,18 @@ public class TestStandardPropertyConfiguration {
|
|||
assertEquals(expectedProperties, config.getProperties());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRenamePropertyToSameName() {
|
||||
assertFalse(config.renameProperty("a", "a"));
|
||||
|
||||
assertFalse(config.isModified());
|
||||
assertTrue(config.hasProperty("a"));
|
||||
assertTrue(config.isPropertySet("a"));
|
||||
|
||||
final Map<String, String> expectedProperties = new HashMap<>(originalProperties);
|
||||
assertEquals(expectedProperties, config.getProperties());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRenameNullProperty() {
|
||||
assertTrue(config.renameProperty("c", "X"));
|
||||
|
|
|
@ -597,7 +597,6 @@ public class InvokeHTTP extends AbstractProcessor {
|
|||
|
||||
@Override
|
||||
public void migrateProperties(final PropertyConfiguration config) {
|
||||
config.renameProperty("Connection Timeout", SOCKET_CONNECT_TIMEOUT.getName());
|
||||
config.renameProperty("Read Timeout", SOCKET_READ_TIMEOUT.getName());
|
||||
config.renameProperty("Remote URL", HTTP_URL.getName());
|
||||
config.renameProperty("disable-http2", HTTP2_DISABLED.getName());
|
||||
|
|
Loading…
Reference in New Issue