use of io.joynr.messaging.bounceproxy.IsCreateChannelHttpRequest in project joynr by bmwcarit.
the class RemoteBounceProxyFacadeTest method testBounceProxyRejectsChannelCreation.
@Test
public void testBounceProxyRejectsChannelCreation() throws Exception {
setMockedHttpRequestHandlerResponse(HttpStatus.SC_NO_CONTENT, "http://www.joynX.de/channels", "X.Y");
ControlledBounceProxyInformation bpInfo = new ControlledBounceProxyInformation("X.Y", URI.create(serverUrl));
try {
bpFacade.createChannel(bpInfo, "channel-123", "trackingId-123");
Assert.fail();
} catch (JoynrProtocolException e) {
}
Mockito.verify(handler).handle(Mockito.argThat(new IsCreateChannelHttpRequest("channel-123", "trackingId-123")), Mockito.any(HttpResponse.class), Mockito.any(HttpContext.class));
}
use of io.joynr.messaging.bounceproxy.IsCreateChannelHttpRequest in project joynr by bmwcarit.
the class RemoteBounceProxyFacadeTest method testBounceProxyReturnsNoLocation.
@Test
public void testBounceProxyReturnsNoLocation() throws Exception {
setMockedHttpRequestHandlerResponse(HttpStatus.SC_CREATED, null, "X.Y");
ControlledBounceProxyInformation bpInfo = new ControlledBounceProxyInformation("X.Y", URI.create(serverUrl));
try {
bpFacade.createChannel(bpInfo, "channel-123", "trackingId-123");
Assert.fail();
} catch (JoynrProtocolException e) {
}
Mockito.verify(handler).handle(Mockito.argThat(new IsCreateChannelHttpRequest("channel-123", "trackingId-123")), Mockito.any(HttpResponse.class), Mockito.any(HttpContext.class));
}
use of io.joynr.messaging.bounceproxy.IsCreateChannelHttpRequest in project joynr by bmwcarit.
the class RemoteBounceProxyFacadeTest method testBounceProxyReturnsNoBounceProxyId.
@Test
public void testBounceProxyReturnsNoBounceProxyId() throws Exception {
setMockedHttpRequestHandlerResponse(HttpStatus.SC_CREATED, "http://www.joynX.de/channels", null);
ControlledBounceProxyInformation bpInfo = new ControlledBounceProxyInformation("X.Y", URI.create(serverUrl));
try {
bpFacade.createChannel(bpInfo, "channel-123", "trackingId-123");
Assert.fail();
} catch (JoynrProtocolException e) {
}
Mockito.verify(handler).handle(Mockito.argThat(new IsCreateChannelHttpRequest("channel-123", "trackingId-123")), Mockito.any(HttpResponse.class), Mockito.any(HttpContext.class));
}
use of io.joynr.messaging.bounceproxy.IsCreateChannelHttpRequest in project joynr by bmwcarit.
the class RemoteBounceProxyFacadeTest method testBounceProxyReturnsUnexpectedBounceProxyId.
@Test
public void testBounceProxyReturnsUnexpectedBounceProxyId() throws Exception {
setMockedHttpRequestHandlerResponse(HttpStatus.SC_CREATED, "http://www.joynX.de/channels", "A.B");
ControlledBounceProxyInformation bpInfo = new ControlledBounceProxyInformation("X.Y", URI.create(serverUrl));
try {
bpFacade.createChannel(bpInfo, "channel-123", "trackingId-123");
Assert.fail();
} catch (JoynrProtocolException e) {
}
Mockito.verify(handler).handle(Mockito.argThat(new IsCreateChannelHttpRequest("channel-123", "trackingId-123")), Mockito.any(HttpResponse.class), Mockito.any(HttpContext.class));
}
use of io.joynr.messaging.bounceproxy.IsCreateChannelHttpRequest in project joynr by bmwcarit.
the class RemoteBounceProxyFacadeTest method testSuccessfulChannelCreation.
@Test
public void testSuccessfulChannelCreation() throws Exception {
setMockedHttpRequestHandlerResponse(HttpStatus.SC_CREATED, "http://www.joynX.de/channels", "X.Y");
ControlledBounceProxyInformation bpInfo = new ControlledBounceProxyInformation("X.Y", URI.create(serverUrl));
URI channelUri = bpFacade.createChannel(bpInfo, "channel-123", "trackingId-123");
Mockito.verify(handler).handle(Mockito.argThat(new IsCreateChannelHttpRequest("channel-123", "trackingId-123")), Mockito.any(HttpResponse.class), Mockito.any(HttpContext.class));
Assert.assertEquals("http://www.joynX.de/channels", channelUri.toString());
}
Aggregations