2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021-2022 Nordix Foundation
4 * Modifications Copyright (C) 2021 Pantheon.tech
5 * Modifications Copyright (C) 2021 Bell Canada.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the 'License');
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an 'AS IS' BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * SPDX-License-Identifier: Apache-2.0
20 * ============LICENSE_END=========================================================
23 package org.onap.cps.spi.impl
25 import com.fasterxml.jackson.databind.ObjectMapper
26 import org.onap.cps.DatabaseTestContainer
27 import org.onap.cps.spi.repository.AnchorRepository
28 import org.onap.cps.spi.repository.DataspaceRepository
29 import org.onap.cps.spi.repository.FragmentRepository
30 import org.onap.cps.spi.repository.YangResourceRepository
31 import org.onap.cps.utils.JsonObjectMapper
32 import org.spockframework.spring.SpringBean
33 import org.springframework.beans.factory.annotation.Autowired
34 import org.springframework.boot.test.context.SpringBootTest
35 import org.testcontainers.spock.Testcontainers
36 import spock.lang.Shared
37 import spock.lang.Specification
41 class CpsPersistenceSpecBase extends Specification {
44 DatabaseTestContainer databaseTestContainer = DatabaseTestContainer.getInstance()
47 DataspaceRepository dataspaceRepository
50 YangResourceRepository yangResourceRepository
53 AnchorRepository anchorRepository
56 FragmentRepository fragmentRepository
59 JsonObjectMapper jsonObjectMapper = new JsonObjectMapper(new ObjectMapper())
61 static final String CLEAR_DATA = '/data/clear-all.sql'
63 static final String DATASPACE_NAME = 'DATASPACE-001'
64 static final String DATASPACE_NAME2 = 'DATASPACE-002'
65 static final String SCHEMA_SET_NAME1 = 'SCHEMA-SET-001'
66 static final String SCHEMA_SET_NAME2 = 'SCHEMA-SET-002'
67 static final String ANCHOR_NAME1 = 'ANCHOR-001'
68 static final String ANCHOR_NAME2 = 'ANCHOR-002'
69 static final String ANCHOR_NAME3 = 'ANCHOR-003'
70 static final String ANCHOR_FOR_DATA_NODES_WITH_LEAVES = 'ANCHOR-003'
71 static final String ANCHOR_FOR_SHOP_EXAMPLE = 'ANCHOR-004'