Mercurial > lada > lada-server
view src/test/java/de/intevation/lada/test/stamm/DeskriptorenTest.java @ 1345:883ab3a6f525 tip
changed version to 2.7-SNAPSHOT after release2.6.2 for default branch
author | Marco Lechner, Bundesamt fuer Strahlenschutz, SW 2.1 <mlechner@bfs.de> |
---|---|
date | Fri, 07 Apr 2017 11:14:37 +0200 |
parents | b652f4c9b75c |
children |
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=3) * and comes with ABSOLUTELY NO WARRANTY! Check out * the documentation coming with IMIS-Labordaten-Application for details. */ package de.intevation.lada.test.stamm; import java.net.URL; import java.util.List; import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import org.junit.Assert; import de.intevation.lada.Protocol; import de.intevation.lada.test.ServiceTest; public class DeskriptorenTest extends ServiceTest { private JsonObject expectedById; private JsonObject create; /** * @return The test protocol */ public List<Protocol> getProtocol() { return protocol; } @Override public void init( URL baseUrl, List<Protocol> protocol ) { super.init(baseUrl, protocol); // Prepare expected object JsonObject content = readJsonResource("/datasets/dbUnit_deskriptor.json") .getJsonArray("stammdaten.deskriptoren").getJsonObject(0); JsonObjectBuilder builder = convertObject(content); expectedById = builder.build(); Assert.assertNotNull(expectedById); } public final void execute() { getAll("deskriptor", "rest/deskriptor"); getAll("deskriptor", "rest/deskriptor?layer=1"); getAll("deskriptor", "rest/deskriptor?layer=1&parents=1, 2"); getById("deskriptor", "rest/deskriptor/1000", expectedById); } }