use of io.joynr.messaging.info.ControlledBounceProxyInformation 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.info.ControlledBounceProxyInformation 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());
}
use of io.joynr.messaging.info.ControlledBounceProxyInformation in project joynr by bmwcarit.
the class RoundRobinAssignmentTest method createBounceProxyRecord.
private BounceProxyRecord createBounceProxyRecord(String bpId) {
ControlledBounceProxyInformation bpInfo = new ControlledBounceProxyInformation(bpId, null);
BounceProxyRecord record = new BounceProxyRecord(bpInfo);
return record;
}
use of io.joynr.messaging.info.ControlledBounceProxyInformation in project joynr by bmwcarit.
the class MonitoringServiceImplTest method testResetBounceProxy.
@Test
public void testResetBounceProxy() {
Mockito.when(bpDirectoryMock.containsBounceProxy("X.Y")).thenReturn(true);
Mockito.when(bpDirectoryMock.getBounceProxy("X.Y")).thenReturn(new BounceProxyRecord(new ControlledBounceProxyInformation("X.Y", null)));
monitoringService.update("X.Y", "http://www.joynX.de/bp", "http://joyn.some-internal-server.de/bpX");
ArgumentCaptor<BounceProxyRecord> argument = ArgumentCaptor.forClass(BounceProxyRecord.class);
Mockito.verify(bpDirectoryMock).updateBounceProxy(argument.capture());
Assert.assertEquals("X.Y", argument.getValue().getBounceProxyId());
Assert.assertEquals("http://www.joynX.de/bp", argument.getValue().getInfo().getLocation().toString());
Assert.assertEquals("http://joyn.some-internal-server.de/bpX", argument.getValue().getInfo().getLocationForBpc().toString());
Assert.assertEquals(BounceProxyStatus.ALIVE, argument.getValue().getStatus());
}
use of io.joynr.messaging.info.ControlledBounceProxyInformation in project joynr by bmwcarit.
the class ControlledBounceProxyInformationTest method testNotEqualsForNull.
@Test
public void testNotEqualsForNull() {
ControlledBounceProxyInformation bpInfo1 = new ControlledBounceProxyInformation("X", "Y", URI.create("http://www.joynX.de"), URI.create("http://joynX.bmwgroup.net"));
Assert.assertFalse(bpInfo1.equals(null));
}
Aggregations