Mercurial > lada > lada-server
changeset 275:758a12cd0dd5
Add tests for findById cases.
Check mostly for 404 because only proben has a findById interface.
author | Ludwig Reiter <ludwig@intevation.de> |
---|---|
date | Fri, 26 Jul 2013 12:49:16 +0200 |
parents | 2a8d816610c4 |
children | 8a66802aa09b |
files | src/main/java/de/intevation/lada/test/RestEasyClient.java |
diffstat | 1 files changed, 26 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/test/RestEasyClient.java Fri Jul 26 12:23:18 2013 +0200 +++ b/src/main/java/de/intevation/lada/test/RestEasyClient.java Fri Jul 26 12:49:16 2013 +0200 @@ -8,7 +8,7 @@ public class RestEasyClient { - public static String baseURL = "https://bfs-lada.intevation.de/lada/server/rest/"; +public static String baseURL = "https://bfs-lada.intevation.de/lada/server/rest/"; public ClientResponse<String> getResponse(String url, boolean header){ ClientRequest request = new ClientRequest(url); @@ -45,48 +45,65 @@ public void testLOrtService(){ testHttpOK(baseURL + "ort?probeId=000007587685X"); testHttpForbidden(baseURL + "ort"); + ClientResponse<String> response = getResponse(baseURL + "ort/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(404, response.getStatus()); } @Test public void testLMessKommentarService() { testHttpOK(baseURL + "messkommentare?probeId=000007587685X&messungsId=1"); testHttpForbidden(baseURL + "messkommentare"); + ClientResponse<String> response = getResponse(baseURL + "messkommentare/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(404, response.getStatus()); } @Test public void testLKommentarService() { testHttpOK(baseURL + "kommentare?probeId=000007587685X"); testHttpForbidden(baseURL + "kommentare"); + ClientResponse<String> response = getResponse(baseURL + "kommentare/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(404, response.getStatus()); } @Test public void testMessungService() { testHttpOK(baseURL + "messung?probeId=000007587685X"); testHttpForbidden(baseURL + "messung"); + ClientResponse<String> response = getResponse(baseURL + "messung/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(404, response.getStatus()); } @Test public void testLMesswertService() { testHttpOK(baseURL + "messwert?probeId=000007587685X&messungsId=1"); testHttpForbidden(baseURL + "messwert"); + ClientResponse<String> response = getResponse(baseURL + "messungwert/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(404, response.getStatus()); } @Test public void testLProbenService() { testHttpOK(baseURL + "proben?mstId=06010&umwId=N24"); testHttpForbidden(baseURL + "proben?mstId=06010&umwId=N24"); + ClientResponse<String> response = getResponse(baseURL + "proben/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(200, response.getStatus()); + checkResponse(response); } @Test public void testLStatusService() { testHttpOK(baseURL + "status?probeId=000007587685X&messungsId=1"); testHttpForbidden(baseURL + "status"); + ClientResponse<String> response = getResponse(baseURL + "status/000007587685X", true); + Assert.assertNotNull(response); + Assert.assertEquals(404, response.getStatus()); } @Test public void testLZusatzwertService() { testHttpOK(baseURL + "zusatzwert?probeId=000007587685X"); testHttpForbidden(baseURL + "zusatzwert"); -} -@Test -public void testLProbenSfindByID() { - ClientResponse<String> response = getResponse(baseURL + "proben/000007587685X", true); + ClientResponse<String> response = getResponse(baseURL + "zusatzwert/000007587685X", true); Assert.assertNotNull(response); - Assert.assertEquals(200, response.getStatus()); - checkResponse(response); + Assert.assertEquals(404, response.getStatus()); } - -} +} \ No newline at end of file