| /******************************************************************************** |
| * Copyright (c) 2015-2018 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| ********************************************************************************/ |
| |
| package org.eclipse.mdm.businessobjects.boundary.integrationtest; |
| |
| import org.eclipse.mdm.api.dflt.model.Pool; |
| import org.eclipse.mdm.api.dflt.model.Project; |
| import org.eclipse.mdm.businessobjects.utils.ServiceUtils; |
| import org.junit.AfterClass; |
| import org.junit.BeforeClass; |
| |
| /** |
| * Test class for {@PoolResource}. |
| * |
| * @author Johannes Stamm, Peak Solution GmbH Nuernberg |
| * @see EntityResourceIntegrationTest |
| * |
| */ |
| public class PoolResourceIntegrationTest extends EntityResourceIntegrationTest { |
| @BeforeClass |
| public static void prepareTestData() { |
| getLogger().debug("Preparing PoolResourceIntegrationTest"); |
| |
| // prepare test data for creating the parent Project |
| ProjectResourceIntegrationTest.prepareTestData(); |
| ProjectResourceIntegrationTest.createEntity(); |
| |
| // set up test data |
| setContextClass(PoolResourceIntegrationTest.class); |
| |
| putTestDataValue(TESTDATA_RESOURCE_URI, "/pools"); |
| putTestDataValue(TESTDATA_ENTITY_NAME, "testPool"); |
| putTestDataValue(TESTDATA_ENTITY_TYPE, "Pool"); |
| |
| Project project = ENTITY_FACTORY |
| .createProject(getTestDataValue(ProjectResourceIntegrationTest.class, TESTDATA_ENTITY_NAME)); |
| ServiceUtils.getCore(project).setID(getTestDataValue(ProjectResourceIntegrationTest.class, TESTDATA_ENTITY_ID)); |
| |
| Pool pool = ENTITY_FACTORY.createPool(getTestDataValue(TESTDATA_ENTITY_NAME), project); |
| |
| putTestDataValue(TESTDATA_CREATE_JSON_BODY, toJson(pool)); |
| } |
| |
| @AfterClass |
| public static void tearDownAfterClass() { |
| // delete project |
| setContextClass(ProjectResourceIntegrationTest.class); |
| ProjectResourceIntegrationTest.deleteEntity(); |
| } |
| } |