Command implements Serializable { public String toRemoteUri(Type endWhenType, Action withAction, Behavior withBehavior) { String baseUri = buildUri(endWhenType); StringBuilder sb = new StringBuilder(baseUri); sb.append(Constants.SEPARATOR_URI.code).append(withAction.name()); sb.append(Constants.REQUEST_PARAMETER_MARKER.code).append(Constants.MARKER_URI_BEHAVIOR.code).append(Constants.PARAM_ASSIGNMENT_MARKER.code); sb.append(withBehavior); return sb.toString(); } Command(String absoluteUri);  Command(Command source); CollectionsTemplate<List<Behavior>, Behavior> templateBehaviors(); void validate(); boolean isRootDomainOnly(); CommandElementLinked root(); boolean isEvent(); Command createRootDomainCommand(); String getAliasUri(Type type); RefId<?> getRefId(Type type); String getAbsoluteUri(Type type); String getAlias(Type type); Optional<CommandElementLinked> getElement(Type type); CommandElementLinked getElementSafely(Type type); String getRelativeUri(String input); boolean isView(); String getAppAlias(); String getRootClientAlias(); CommandElement getRootDomainElement(); String getRootDomainAlias(); String getRootDomainUri(); String getAbsoluteDomainAlias(); String getAbsoluteDomainUri(); String getProcessAlias(); String getProcessUri(); String getAbsoluteAlias(); String getAbsoluteAliasWithAction(); String getAbsoluteAliasTillRootDomain(); String buildAlias(CommandElementLinked startElem); String buildAlias(Type endWhentype); String buildAlias(CommandElementLinked startElem, Type endWhentype); String buildUri(CommandElementLinked startElem); String buildUri(Type endWhenType); String buildUri(CommandElementLinked startElem, Type endWhenType); String traverseElements(CommandElementLinked startElem, BiConsumer<CommandElement, StringBuilder> cb); void traverseElements(CommandElementLinked startElem, Consumer<CommandElement> cb); String traverseElements(CommandElementLinked startElem, Type type, BiConsumer<CommandElement, StringBuilder> cb); void traverseElements(CommandElementLinked startElem, Type type, Consumer<CommandElement> cb); CommandElementLinked createRoot(Type type, String uri); String toUri(); String toRemoteUri(Type endWhenType, Action withAction, Behavior withBehavior); String[] getParameterValue(String requestParameter); String getFirstParameterValue(String requestParameter); boolean hasRawPayload(); String getRawPayload(); boolean containsFunction();  }
@Test public void testBuildRemoteUri() { String uri = "/client_xyz/app_abc/p/domainRoot_alias/nestedDomain/abc/_new?b=$executeAnd$save&criteria=customer.name.eq(\"John\")"; Command cmd = CommandBuilder.withUri(uri).getCommand(); assertNotNull(cmd); String buildUri = cmd.toRemoteUri(Type.ParamName, Action._new, Behavior.$execute); assertThat(buildUri).isEqualTo("/client_xyz/app_abc/p/domainRoot_alias/nestedDomain/abc/_new?b=$execute"); }