@Test public void testOnPropertyModified() throws Exception { final InvokeHTTP processor = new InvokeHTTP(); final Field regexAttributesToSendField = InvokeHTTP.class.getDeclaredField("regexAttributesToSend"); regexAttributesToSendField.setAccessible(true); assertNull(regexAttributesToSendField.get(processor)); processor.onPropertyModified(InvokeHTTP.PROP_ATTRIBUTES_TO_SEND, null, "uuid"); assertNotNull(regexAttributesToSendField.get(processor)); processor.onPropertyModified(InvokeHTTP.PROP_ATTRIBUTES_TO_SEND, "uuid", null); assertNull(regexAttributesToSendField.get(processor)); processor.onPropertyModified(InvokeHTTP.PROP_ATTRIBUTES_TO_SEND, null, "uuid"); assertNotNull(regexAttributesToSendField.get(processor)); processor.onPropertyModified(InvokeHTTP.PROP_ATTRIBUTES_TO_SEND, "uuid", ""); assertNull(regexAttributesToSendField.get(processor)); }
@Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.isDynamic()) { final Set<String> newDynamicPropertyNames = new HashSet<>(dynamicPropertyNames); if (newValue == null) { newDynamicPropertyNames.remove(descriptor.getName()); } else if (oldValue == null) { newDynamicPropertyNames.add(descriptor.getName()); } this.dynamicPropertyNames = Collections.unmodifiableSet(newDynamicPropertyNames); } else { if (PROP_ATTRIBUTES_TO_SEND.getName().equalsIgnoreCase(descriptor.getName())) { if (newValue == null || newValue.isEmpty()) { regexAttributesToSend = null; } else { final String trimmedValue = StringUtils.trimToEmpty(newValue); regexAttributesToSend = Pattern.compile(trimmedValue); } } } }
InvokeHTTP extends AbstractProcessor { @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.isDynamic()) { final Set<String> newDynamicPropertyNames = new HashSet<>(dynamicPropertyNames); if (newValue == null) { newDynamicPropertyNames.remove(descriptor.getName()); } else if (oldValue == null) { newDynamicPropertyNames.add(descriptor.getName()); } this.dynamicPropertyNames = Collections.unmodifiableSet(newDynamicPropertyNames); } else { if (PROP_ATTRIBUTES_TO_SEND.getName().equalsIgnoreCase(descriptor.getName())) { if (newValue == null || newValue.isEmpty()) { regexAttributesToSend = null; } else { final String trimmedValue = StringUtils.trimToEmpty(newValue); regexAttributesToSend = Pattern.compile(trimmedValue); } } } } }
InvokeHTTP extends AbstractProcessor { @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.isDynamic()) { final Set<String> newDynamicPropertyNames = new HashSet<>(dynamicPropertyNames); if (newValue == null) { newDynamicPropertyNames.remove(descriptor.getName()); } else if (oldValue == null) { newDynamicPropertyNames.add(descriptor.getName()); } this.dynamicPropertyNames = Collections.unmodifiableSet(newDynamicPropertyNames); } else { if (PROP_ATTRIBUTES_TO_SEND.getName().equalsIgnoreCase(descriptor.getName())) { if (newValue == null || newValue.isEmpty()) { regexAttributesToSend = null; } else { final String trimmedValue = StringUtils.trimToEmpty(newValue); regexAttributesToSend = Pattern.compile(trimmedValue); } } } }  }
InvokeHTTP extends AbstractProcessor { @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.isDynamic()) { final Set<String> newDynamicPropertyNames = new HashSet<>(dynamicPropertyNames); if (newValue == null) { newDynamicPropertyNames.remove(descriptor.getName()); } else if (oldValue == null) { newDynamicPropertyNames.add(descriptor.getName()); } this.dynamicPropertyNames = Collections.unmodifiableSet(newDynamicPropertyNames); } else { if (PROP_ATTRIBUTES_TO_SEND.getName().equalsIgnoreCase(descriptor.getName())) { if (newValue == null || newValue.isEmpty()) { regexAttributesToSend = null; } else { final String trimmedValue = StringUtils.trimToEmpty(newValue); regexAttributesToSend = Pattern.compile(trimmedValue); } } } }  @Override Set<Relationship> getRelationships(); @Override void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue); @OnScheduled void setUpClient(final ProcessContext context); @Override void onTrigger(ProcessContext context, ProcessSession session); }
InvokeHTTP extends AbstractProcessor { @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { if (descriptor.isDynamic()) { final Set<String> newDynamicPropertyNames = new HashSet<>(dynamicPropertyNames); if (newValue == null) { newDynamicPropertyNames.remove(descriptor.getName()); } else if (oldValue == null) { newDynamicPropertyNames.add(descriptor.getName()); } this.dynamicPropertyNames = Collections.unmodifiableSet(newDynamicPropertyNames); } else { if (PROP_ATTRIBUTES_TO_SEND.getName().equalsIgnoreCase(descriptor.getName())) { if (newValue == null || newValue.isEmpty()) { regexAttributesToSend = null; } else { final String trimmedValue = StringUtils.trimToEmpty(newValue); regexAttributesToSend = Pattern.compile(trimmedValue); } } } }  @Override Set<Relationship> getRelationships(); @Override void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue); @OnScheduled void setUpClient(final ProcessContext context); @Override void onTrigger(ProcessContext context, ProcessSession session); final static String STATUS_CODE; final static String STATUS_MESSAGE; final static String RESPONSE_BODY; final static String REQUEST_URL; final static String TRANSACTION_ID; final static String REMOTE_DN; final static String EXCEPTION_CLASS; final static String EXCEPTION_MESSAGE; static final String DEFAULT_CONTENT_TYPE; static final Set<String> IGNORED_ATTRIBUTES; static final PropertyDescriptor PROP_METHOD; static final PropertyDescriptor PROP_URL; static final PropertyDescriptor PROP_CONNECT_TIMEOUT; static final PropertyDescriptor PROP_READ_TIMEOUT; static final PropertyDescriptor PROP_DATE_HEADER; static final PropertyDescriptor PROP_FOLLOW_REDIRECTS; static final PropertyDescriptor PROP_ATTRIBUTES_TO_SEND; static final PropertyDescriptor PROP_SSL_CONTEXT_SERVICE; static final PropertyDescriptor PROP_PROXY_HOST; static final PropertyDescriptor PROP_PROXY_PORT; static final PropertyDescriptor PROP_PROXY_USER; static final PropertyDescriptor PROP_PROXY_PASSWORD; static final PropertyDescriptor PROP_CONTENT_TYPE; static final PropertyDescriptor PROP_SEND_BODY; static final PropertyDescriptor PROP_BASIC_AUTH_USERNAME; static final PropertyDescriptor PROP_BASIC_AUTH_PASSWORD; static final PropertyDescriptor PROP_PUT_OUTPUT_IN_ATTRIBUTE; static final PropertyDescriptor PROP_PUT_ATTRIBUTE_MAX_LENGTH; static final PropertyDescriptor PROP_DIGEST_AUTH; static final PropertyDescriptor PROP_OUTPUT_RESPONSE_REGARDLESS; static final PropertyDescriptor PROP_TRUSTED_HOSTNAME; static final PropertyDescriptor PROP_ADD_HEADERS_TO_REQUEST; static final PropertyDescriptor PROP_USE_CHUNKED_ENCODING; static final PropertyDescriptor PROP_PENALIZE_NO_RETRY; static final List<PropertyDescriptor> PROPERTIES; static final Relationship REL_SUCCESS_REQ; static final Relationship REL_RESPONSE; static final Relationship REL_RETRY; static final Relationship REL_NO_RETRY; static final Relationship REL_FAILURE; static final Set<Relationship> RELATIONSHIPS; }