### Question:
TaskHelper { public static String buildUrl(RuntimeCamelCatalog rcc, Map<String, String> props, String componentSchema, String endpointPropertiesPrefix, String pathPropertiesPrefix) throws URISyntaxException { ComponentModel cm = null; if (componentSchema != null) { String json = rcc.componentJSonSchema(componentSchema); if (json != null) { cm = JsonMapper.generateComponentModel(json); } } Map<String, String> filteredProps = new HashMap<>(); props.keySet().stream() .filter(k -> k.startsWith(endpointPropertiesPrefix) || k.startsWith(pathPropertiesPrefix)) .forEach(k -> filteredProps.put(k.replace(endpointPropertiesPrefix, "").replace(pathPropertiesPrefix, ""), props.get(k))); if (cm != null) { for (String k : filteredProps.keySet()) { if (isSecretOption(rcc, cm, k)) { String value = filteredProps.get(k); if (value != null && !value.startsWith("#") && !value.startsWith("RAW(")) { value = "RAW(" + value + ")"; filteredProps.put(k, value); } } } } return rcc.asEndpointUri(componentSchema, filteredProps, false); } private  TaskHelper(); static String buildUrl(RuntimeCamelCatalog rcc, Map<String, String> props, String componentSchema, String endpointPropertiesPrefix, String pathPropertiesPrefix); static String buildUrl(Map<String, String> props, String componentSchema, String endpointPropertiesPrefix, String pathPropertiesPrefix); static String createEndpointOptionsFromProperties(Map<String, String> props, String prefix); static String createUrlPathFromProperties(Map<String, String> props, String prefix); static Map<String, String> mergeProperties(Map<String, String> defaultProps, Map<String, String> loadedProps); static void logRecordContent(Logger logger, ConnectRecord<?> record, CFG config);  }### Answer:
@Test public void testBuildUrl() { Map<String, String> props = new HashMap<String, String>() { { put("prefix.key1", "value1"); put("anotherPrefix.key2", "value2"); } }; String result = TaskHelper.buildUrl(props, "test", "prefix.", "anotherPrefix."); assertEquals("test:value2?key1=value1", result); }
@Test public void testBuildUrlWithRuntimeCatalog() throws URISyntaxException { DefaultCamelContext dcc = new DefaultCamelContext(); RuntimeCamelCatalog rcc = dcc.adapt(ExtendedCamelContext.class).getRuntimeCamelCatalog(); Map<String, String> props = new HashMap<String, String>() { { put("camel.source.path.name", "test"); put("camel.source.endpoint.synchronous", "true"); } }; String result = TaskHelper.buildUrl(rcc, props, "direct", "camel.source.endpoint.", "camel.source.path."); assertEquals("direct:test?synchronous=true", result); props = new HashMap<String, String>() { { put("camel.source.path.port", "8080"); put("camel.source.path.keyspace", "test"); put("camel.source.path.hosts", "localhost"); } }; result = TaskHelper.buildUrl(rcc, props, "cql", "camel.source.endpoint.", "camel.source.path."); assertEquals("cql:localhost:8080/test", result); }