Remove the dependency-cycle between beans
[cps.git] / integration-test / src / test / groovy / org / onap / cps / integration / performance / cps / CpsDataspaceServiceLimitsPerfTest.groovy
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 2023 Nordix Foundation
4  *  ================================================================================
5  *  Licensed under the Apache License, Version 2.0 (the 'License');
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an 'AS IS' BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  *  SPDX-License-Identifier: Apache-2.0
18  *  ============LICENSE_END=========================================================
19  */
20
21 package org.onap.cps.integration.performance.cps
22
23 import org.onap.cps.api.CpsAnchorService
24 import org.onap.cps.integration.performance.base.CpsPerfTestBase
25
26 class CpsDataspaceServiceLimitsPerfTest extends CpsPerfTestBase {
27
28     CpsAnchorService objectUnderTest
29
30     def setup() { objectUnderTest = cpsAnchorService }
31
32     def 'Get anchors from multiple schema set names limit exceeded: 32,766 (~ 2^15) schema set names.'() {
33         given: 'more than 32,766 schema set names'
34             def schemaSetNames = (0..40_000).collect { "size-of-this-name-does-not-matter-for-limit-" + it }
35         when: 'single get is executed to get all the anchors'
36             objectUnderTest.getAnchors(CPS_PERFORMANCE_TEST_DATASPACE, schemaSetNames)
37         then: 'a database exception is not thrown'
38             noExceptionThrown()
39     }
40
41     def 'Querying anchor names limit exceeded: 32,766 (~ 2^15) modules.'() {
42         given: 'more than 32,766 module names'
43             def moduleNames = (0..40_000).collect { "size-of-this-name-does-not-matter-for-limit-" + it }
44         when: 'single query is executed to get all the anchors'
45             objectUnderTest.queryAnchorNames(CPS_PERFORMANCE_TEST_DATASPACE, moduleNames)
46         then: 'a database exception is not thrown'
47             noExceptionThrown()
48     }
49
50 }