Mercurial > lada > lada-server
view src/test/java/de/intevation/lada/test/stamm/ProbenehmerTest.java @ 849:d0a591b3eade
Added missing file header.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 27 Jan 2016 15:32:49 +0100 |
parents | 075f511243d5 |
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.Arrays; 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 ProbenehmerTest 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); // Attributes with timestamps timestampAttributes = Arrays.asList(new String[]{ "letzteAenderung" }); // Prepare expected object JsonObject content = readJsonResource("/datasets/dbUnit_probenehmer.json"); JsonObject probenehmer = content.getJsonArray("stammdaten.probenehmer").getJsonObject(0); JsonObjectBuilder builder = convertObject(probenehmer); expectedById = builder.build(); Assert.assertNotNull(expectedById); // Load object to test POST request create = readJsonResource("/datasets/probenehmer.json"); Assert.assertNotNull(create); } public final void execute() { getAll("probenehmer", "rest/probenehmer"); getById("probenehmer", "rest/probenehmer/1000", expectedById); update("probenehmer", "rest/probenehmer/1000", "bezeichnung", "Testbezeichnung", "geƤndert"); JsonObject created = create("probenehmer", "rest/probenehmer", create); delete("probenehmer", "rest/probenehmer/" + created.getJsonObject("data").get("id")); } }