Merge "Make CategoryParameter.getOptions() unmodifiable"
authorIttay Stern <ittay.stern@att.com>
Wed, 12 Dec 2018 11:22:20 +0000 (11:22 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 12 Dec 2018 11:22:20 +0000 (11:22 +0000)
1  2 
vid-app-common/src/test/java/org/onap/vid/services/CategoryParameterServiceImplTest.java

@@@ -155,12 -158,13 +156,13 @@@ public class CategoryParameterServiceIm
      @Test
      public void deleteCategoryOption_happyPath() {
          CategoryParameter categoryParameter = createCategoryParameter(CATEGORY_NAME, true);
+         CategoryParameter anotherCategoryParameter = createCategoryParameter(CATEGORY_NAME, true);
          CategoryParameterOption categoryParameterOption =
-             new CategoryParameterOption(APP_ID_VID, OPTION_NAME, categoryParameter);
-         categoryParameter.getOptions().add(categoryParameterOption);
+             new CategoryParameterOption(APP_ID_VID, OPTION_NAME, anotherCategoryParameter);
+         categoryParameter.addOption(categoryParameterOption);
          List<CategoryParameter> aList = createCategoryParametersList(categoryParameter);
  
 -        doReturn(aList).when(dataAccessService).getList(anyObject(), anyString(), anyString(), anyObject());
 +        doReturn(aList).when(dataAccessService).getList(any(), anyString(), any(), any());
  
          testSubject.deleteCategoryOption(CATEGORY_NAME, categoryParameterOption);
  
      @Test
      public void getCategoryParametersTest() {
          CategoryParameter categoryParameter = createCategoryParameter(CATEGORY_NAME, true);
+         CategoryParameter anotherCategoryParameter = createCategoryParameter(CATEGORY_NAME, true);
          CategoryParameterOption categoryParameterOption =
-             new CategoryParameterOption(APP_ID_VID, OPTION_NAME, categoryParameter);
-         categoryParameter.getOptions().add(categoryParameterOption);
+             new CategoryParameterOption(APP_ID_VID, OPTION_NAME, anotherCategoryParameter);
+         categoryParameter.addOption(categoryParameterOption);
          List<CategoryParameter> aList = createCategoryParametersList(categoryParameter);
  
 -        doReturn(aList).when(dataAccessService).getList(anyObject(), anyString(), anyString(), anyObject());
 +        doReturn(aList).when(dataAccessService).getList(any(), anyString(), any(), any());
  
          CategoryParametersResponse response = testSubject.getCategoryParameters(Family.PARAMETER_STANDARDIZATION);