/** * A local OBIX server has to be running in order to pass this test. * * <p>The IoTSYS System can be used for this: https://github.com/mjung85/iotsys/ */ @Test public void getLobbyShouldReturnEmptyLobbyOnlyWithResponseString() { String uri = "localhost/obix"; CoapClient coapClient = new CoapClient(uri); // False, if the coap client is offline org.junit.Assume.assumeTrue(coapClient.ping()); ObixLobby lobby = undecoratedCoapChannel.getLobby(uri); Assert.assertThat(lobby.getLobbyAsString(), CoreMatchers.containsString("href=\"obix/\"")); }
@Test() public void getLobbyWithWrongURIShouldReturnErr() { ObixLobby lobby = undecoratedCoapChannel.getLobby("wrong"); Obj lobbyObj = ObixXmlChannelDecorator.decode(lobby.getLobbyAsString()); Assert.assertTrue(lobbyObj.isErr()); }