diff options
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()); + } } |