use of org.talend.schemas.esb.locator.rest._2011._11.RegisterEndpointRequest in project tesb-rt-se by Talend.
the class LocatorRestServiceTest method registerEndpointWithOptParam.
@Test
public void registerEndpointWithOptParam() throws ServiceLocatorException, InterruptedException {
sl.register(endpoint(), EasyMock.eq(true));
EasyMock.expectLastCall();
replayAll();
RegisterEndpointRequest req = new RegisterEndpointRequest();
req.setEndpointURL(ENDPOINTURL);
req.setServiceName(SERVICE_NAME.toString());
req.setBinding(BindingType.JAXRS);
req.setTransport(TransportType.HTTPS);
lps.registerEndpoint(req);
}
use of org.talend.schemas.esb.locator.rest._2011._11.RegisterEndpointRequest in project tesb-rt-se by Talend.
the class LocatorRestServiceTest method registerEndpointExpectedLocatorException.
@Test(expected = WebApplicationException.class)
public void registerEndpointExpectedLocatorException() throws ServiceLocatorException, InterruptedException {
sl.register(endpoint(), EasyMock.eq(true));
EasyMock.expectLastCall().andStubThrow(new ServiceLocatorException("test"));
replayAll();
RegisterEndpointRequest req = new RegisterEndpointRequest();
EntryType entryType = new EntryType();
entryType.setKey("test");
entryType.getValue().add("test");
req.getEntryType().add(entryType);
req.setEndpointURL(ENDPOINTURL);
req.setServiceName(SERVICE_NAME.toString());
lps.registerEndpoint(req);
}
use of org.talend.schemas.esb.locator.rest._2011._11.RegisterEndpointRequest in project tesb-rt-se by Talend.
the class RESTClient method registerExample.
private void registerExample(LocatorService client, String service, String endpoint) {
System.out.println("------------------------------");
System.out.println("Register service with endpoint");
System.out.println("ServiceName: ".concat(service));
System.out.println("EndpointURL: ".concat(endpoint));
RegisterEndpointRequest registerEndpointRequest = new RegisterEndpointRequest();
registerEndpointRequest.setBinding(BindingType.JAXRS);
registerEndpointRequest.setTransport(TransportType.HTTPS);
registerEndpointRequest.setEndpointURL(endpoint);
registerEndpointRequest.setServiceName(service);
try {
client.registerEndpointRegisterEndpointRequestXml(registerEndpointRequest);
System.out.println("Endpoint registered successfully");
} catch (WebApplicationException ex) {
System.err.println(ex.getMessage());
}
}
Aggregations