@Test public void notFoundWithoutValidParams() throws IOException, TmcCoreException { HttpResult result = urlCommunicator.makeGetRequest(URI.create(serverAddress), "ihanvaaraheaderi:1234"); assertEquals(403, result.getStatusCode()); }
@Test public void okWithValidParams() throws IOException, TmcCoreException { HttpResult result = urlCommunicator.makeGetRequest(URI.create(serverAddress), "test:1234"); assertEquals(200, result.getStatusCode()); }
@Test public void badRequestWithoutValidUrl() throws IOException, TmcCoreException { HttpResult result = urlCommunicator.makeGetRequest(URI.create(serverAddress + "/vaaraurl"), "test:1234"); assertEquals(400, result.getStatusCode()); }
@Test(expected = IOException.class) public void badGetRequestIsThrown() throws IOException, TmcCoreException { urlCommunicator.makeGetRequest(URI.create("asasdasd"), "chang:/\\\\eiparas"); }