diff options
author | vasraz <vasyl.razinkov@est.tech> | 2023-05-24 17:30:41 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-06-08 19:44:38 +0000 |
commit | 98f08c1f9b617e670cd4c71321c9152e8f63b18c (patch) | |
tree | 5823c85f9c16dd24918438e251238ba770532a91 /common-be/src/test | |
parent | 1c4fe946f65fb4e7db5cc5d4225b14ec6cc22306 (diff) |
Update external query api with new query params
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: Ib4970d4f57f9e236f520ca1925915d288c9c5236
Issue-ID: SDC-4409
Diffstat (limited to 'common-be/src/test')
-rw-r--r-- | common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java | 73 |
1 files changed, 34 insertions, 39 deletions
diff --git a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java index 54f90e65b3..b08a32fc05 100644 --- a/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java +++ b/common-be/src/test/java/org/openecomp/sdc/be/datatypes/enums/FilterKeyEnumTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -20,43 +20,38 @@ package org.openecomp.sdc.be.datatypes.enums; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum.CATEGORY; +import static org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum.RESOURCE_TYPE; +import static org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum.VERSION; import java.util.List; - -public class FilterKeyEnumTest { - - private FilterKeyEnum createTestSubject() { - return FilterKeyEnum.CATEGORY; - } - - @Test - public void testGetName() throws Exception { - FilterKeyEnum testSubject; - String result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getName(); - } - - @Test - public void testGetAllFilters() throws Exception { - List<String> result; - - // default test - result = FilterKeyEnum.getAllFilters(); - } - - @Test - public void testGetValidFiltersByAssetType() throws Exception { - ComponentTypeEnum assetType = null; - List<String> result; - - // default test - result = FilterKeyEnum.getValidFiltersByAssetType(ComponentTypeEnum.RESOURCE); - result = FilterKeyEnum.getValidFiltersByAssetType(ComponentTypeEnum.SERVICE); - result = FilterKeyEnum.getValidFiltersByAssetType(ComponentTypeEnum.SERVICE_INSTANCE); - result = FilterKeyEnum.getValidFiltersByAssetType(assetType); - } +import org.junit.jupiter.api.Test; + +class FilterKeyEnumTest { + + @Test + void testGetValidFiltersByAssetType() { + List<String> result; + + result = FilterKeyEnum.getValidFiltersByAssetType(ComponentTypeEnum.RESOURCE); + assertNotNull(result); + assertEquals(3, result.size()); + assertTrue(result.contains(CATEGORY.getName())); + assertFalse(result.contains(VERSION.getName())); + result = FilterKeyEnum.getValidFiltersByAssetType(ComponentTypeEnum.SERVICE); + assertNotNull(result); + assertEquals(4, result.size()); + assertTrue(result.contains(CATEGORY.getName())); + assertFalse(result.contains(RESOURCE_TYPE.getName())); + result = FilterKeyEnum.getValidFiltersByAssetType(ComponentTypeEnum.SERVICE_INSTANCE); + assertNotNull(result); + assertEquals(0, result.size()); + result = FilterKeyEnum.getValidFiltersByAssetType(null); + assertNotNull(result); + assertEquals(0, result.size()); + } } |