8ec5c90e9ca9b990d40e05df6359561a2b736a5a
[cps.git] / cps-ri / src / test / groovy / org / onap / cps / spi / impl / CpsPersistenceSpecBase.groovy
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 2021 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
10  *
11  *        http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  *  SPDX-License-Identifier: Apache-2.0
20  *  ============LICENSE_END=========================================================
21  */
22
23 package org.onap.cps.spi.impl
24
25 import org.onap.cps.DatabaseTestContainer
26 import org.onap.cps.spi.repository.AnchorRepository
27 import org.onap.cps.spi.repository.DataspaceRepository
28 import org.onap.cps.spi.repository.FragmentRepository
29 import org.onap.cps.spi.repository.YangResourceRepository
30 import org.springframework.beans.factory.annotation.Autowired
31 import org.springframework.boot.test.context.SpringBootTest
32 import org.testcontainers.spock.Testcontainers
33 import spock.lang.Shared
34 import spock.lang.Specification
35
36 @SpringBootTest
37 @Testcontainers
38 class CpsPersistenceSpecBase extends Specification {
39
40     @Shared
41     DatabaseTestContainer databaseTestContainer = DatabaseTestContainer.getInstance()
42
43     @Autowired
44     DataspaceRepository dataspaceRepository
45
46     @Autowired
47     YangResourceRepository yangResourceRepository
48
49     @Autowired
50     AnchorRepository anchorRepository
51
52     @Autowired
53     FragmentRepository fragmentRepository
54
55     static final String CLEAR_DATA = '/data/clear-all.sql'
56
57     static final String DATASPACE_NAME = 'DATASPACE-001'
58     static final String DATASPACE_NAME2 = 'DATASPACE-002'
59     static final String SCHEMA_SET_NAME1 = 'SCHEMA-SET-001'
60     static final String SCHEMA_SET_NAME2 = 'SCHEMA-SET-002'
61     static final String ANCHOR_NAME1 = 'ANCHOR-001'
62     static final String ANCHOR_NAME2 = 'ANCHOR-002'
63     static final String ANCHOR_NAME3 = 'ANCHOR-003'
64     static final String ANCHOR_FOR_DATA_NODES_WITH_LEAVES = 'ANCHOR-003'
65     static final String ANCHOR_FOR_SHOP_EXAMPLE = 'ANCHOR-004'
66 }