Fixing minor compilation
[cps.git] / cps-ri / src / test / groovy / org / onap / cps / spi / impl / CpsPersistenceSpecBase.groovy
1 /*
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  *  Modifications Copyright (C) 2023 TechMahindra Ltd.
7  *  ================================================================================
8  *  Licensed under the Apache License, Version 2.0 (the 'License');
9  *  you may not use this file except in compliance with the License.
10  *  You may obtain a copy of the License at
11  *
12  *        http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *  Unless required by applicable law or agreed to in writing, software
15  *  distributed under the License is distributed on an 'AS IS' BASIS,
16  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  *  See the License for the specific language governing permissions and
18  *  limitations under the License.
19  *
20  *  SPDX-License-Identifier: Apache-2.0
21  *  ============LICENSE_END=========================================================
22  */
23
24 package org.onap.cps.spi.impl
25
26 import com.fasterxml.jackson.databind.ObjectMapper
27 import org.onap.cps.DatabaseTestContainer
28 import org.onap.cps.spi.repository.AnchorRepository
29 import org.onap.cps.spi.repository.DataspaceRepository
30 import org.onap.cps.spi.repository.FragmentRepository
31 import org.onap.cps.spi.repository.YangResourceRepository
32 import org.onap.cps.utils.JsonObjectMapper
33 import org.spockframework.spring.SpringBean
34 import org.springframework.beans.factory.annotation.Autowired
35 import org.springframework.boot.test.context.SpringBootTest
36 import org.testcontainers.spock.Testcontainers
37 import spock.lang.Shared
38 import spock.lang.Specification
39
40 @SpringBootTest
41 @Testcontainers
42 class CpsPersistenceSpecBase extends Specification {
43
44     @Shared
45     DatabaseTestContainer databaseTestContainer = DatabaseTestContainer.getInstance()
46
47     @Autowired
48     DataspaceRepository dataspaceRepository
49
50     @Autowired
51     YangResourceRepository yangResourceRepository
52
53     @Autowired
54     AnchorRepository anchorRepository
55
56     @Autowired
57     FragmentRepository fragmentRepository
58
59     @SpringBean
60     JsonObjectMapper jsonObjectMapper = new JsonObjectMapper(new ObjectMapper())
61
62     protected static final String CLEAR_DATA = '/data/clear-all.sql'
63
64     static def DATASPACE_NAME = 'DATASPACE-001'
65     static def SCHEMA_SET_NAME1 = 'SCHEMA-SET-001'
66     static def SCHEMA_SET_NAME2 = 'SCHEMA-SET-002'
67     static def ANCHOR_NAME1 = 'ANCHOR-001'
68     static def ANCHOR_NAME2 = 'ANCHOR-002'
69     static def ANCHOR_NAME3 = 'ANCHOR-003'
70     static def ANCHOR_FOR_DATA_NODES_WITH_LEAVES = 'ANCHOR-003'
71     static def ANCHOR_FOR_SHOP_EXAMPLE = 'ANCHOR-004'
72     static def ANCHOR_HAVING_SINGLE_TOP_LEVEL_FRAGMENT = 'ANCHOR-005'
73     static def ANCHOR_WITH_MULTIPLE_TOP_LEVEL_FRAGMENTS = 'ANCHOR-006'
74 }