EndpointUtil { public static String encodeEndpoint(String uri, String operation) { StringBuilder buf=new StringBuilder(); if (uri != null && !uri.trim().isEmpty()) { buf.append(uri); } if (operation != null && !operation.trim().isEmpty()) { buf.append('['); buf.append(operation); buf.append(']'); } return buf.toString(); }  static String encodeEndpoint(String uri, String operation); static String decodeEndpointURI(String endpoint); static String decodeEndpointOperation(String endpoint, boolean stripped); static String encodeClientURI(String uri); static String decodeClientURI(String clientUri); static EndpointRef getSourceEndpoint(Trace fragment);  }
@Test public void testEndpointUri() { assertEquals(URI, EndpointUtil.encodeEndpoint(URI, null)); }
@Test public void testEndpointUriAndOperation() { String result = EndpointUtil.encodeEndpoint(URI, OPERATION); String expected = URI + "[" + OPERATION + "]"; assertEquals(expected, result); }