public class EndpointTest extends BaseTestCase {
public void testAddEndpoint() throws Exception {
// first add an endpoint, get it delete it, simply stuff like that.
EndpointManager endpointManager = new EndpointManager(registry);
Endpoint endpoint1 = endpointManager.newEndpoint("http://localhost/papapa/booom");
endpoint1.addAttribute("status", "QA");
endpointManager.addEndpoint(endpoint1);
assertEquals("/endpoints/localhost/papapa/ep-booom", endpoint1.getPath());
// now get the endpoint back.
Endpoint endpoint2 = endpointManager.getEndpoint(endpoint1.getId());
assertEquals("http://localhost/papapa/booom", endpoint2.getUrl());
assertEquals("QA", endpoint1.getAttribute("status"));
// so we will be deleting the endpoint
endpointManager.removeEndpoint(endpoint2.getId());
assertTrue(true);
endpoint2 = endpointManager.getEndpoint(endpoint2.getId());
assertNull(endpoint2);
}