Replace gson mapper with jackson mapper
[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  *  ================================================================================
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 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
38
39 @SpringBootTest
40 @Testcontainers
41 class CpsPersistenceSpecBase extends Specification {
42
43     @Shared
44     DatabaseTestContainer databaseTestContainer = DatabaseTestContainer.getInstance()
45
46     @Autowired
47     DataspaceRepository dataspaceRepository
48
49     @Autowired
50     YangResourceRepository yangResourceRepository
51
52     @Autowired
53     AnchorRepository anchorRepository
54
55     @Autowired
56     FragmentRepository fragmentRepository
57
58     @SpringBean
59     JsonObjectMapper jsonObjectMapper = new JsonObjectMapper(new ObjectMapper())
60
61     static final String CLEAR_DATA = '/data/clear-all.sql'
62
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'
72 }