public SyncMockDefinitionBuilder restMock(String endpointUri) { try { if (!URISupport.parseParameters(new URI(endpointUri)).containsKey("matchOnUriPrefix")) { Map<String, Object> params = new HashMap<>(); params.put("matchOnUriPrefix", "true"); endpointUri = URISupport.appendParametersToURI(endpointUri, params); } } catch (URISyntaxException | UnsupportedEncodingException e) { throw new RuntimeException(e); } return syncMock(endpointUri); }
private static String buildUri(Endpoint step) { String uri = step.getUri(); Map<String, Object> properties = step.getProperties(); if (!Strings.isEmpty(uri)) { if (ObjectHelper.isNotEmpty(properties)) { try { uri = URISupport.appendParametersToURI(uri, properties); } catch (UnsupportedEncodingException|URISyntaxException e) { throw ObjectHelper.wrapRuntimeCamelException(e); } } } return uri; } }
service, params, URISupport.appendParametersToURI(delegateUri, parameters) );
uri = URISupport.appendParametersToURI(uri, Map.class.cast(properties)); } catch (UnsupportedEncodingException |URISyntaxException e) { throw ObjectHelper.wrapRuntimeCamelException(e);
params.put("endDelimiter", MUSTACHE_CLOSE_DELIMITER); uri = URISupport.appendParametersToURI(uri, params); route = route.to(uri);
uri = URISupport.appendParametersToURI(uri, Map.class.cast(properties)); } catch (UnsupportedEncodingException |URISyntaxException e) { throw ObjectHelper.wrapRuntimeCamelException(e);