diff --git a/app/src/test/java/ch/sbb/polarion/extension/generic/configuration/ConfigurationStatusProviderTest.java b/app/src/test/java/ch/sbb/polarion/extension/generic/configuration/ConfigurationStatusProviderTest.java index 96ae659..e9578a8 100644 --- a/app/src/test/java/ch/sbb/polarion/extension/generic/configuration/ConfigurationStatusProviderTest.java +++ b/app/src/test/java/ch/sbb/polarion/extension/generic/configuration/ConfigurationStatusProviderTest.java @@ -10,7 +10,6 @@ import java.util.Set; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mockStatic; diff --git a/app/src/test/java/ch/sbb/polarion/extension/generic/fields/CustomFieldEnumConverterTest.java b/app/src/test/java/ch/sbb/polarion/extension/generic/fields/CustomFieldEnumConverterTest.java index 0b67c34..b5c17f6 100644 --- a/app/src/test/java/ch/sbb/polarion/extension/generic/fields/CustomFieldEnumConverterTest.java +++ b/app/src/test/java/ch/sbb/polarion/extension/generic/fields/CustomFieldEnumConverterTest.java @@ -80,14 +80,6 @@ void testGetEnumOptionById() { } - @Test - void testGetEnumOptionByValue() { - FieldMetadata fieldMetadata = ConverterTestUtils.getWorkItemCustomField(); - - assertEquals(new EnumOption(YES_NO_ENUM_ID, YES.left()), ConverterTestUtils.process(YES.left(), fieldMetadata)); - assertEquals(new EnumOption(YES_NO_ENUM_ID, NO.left()), ConverterTestUtils.process(NO.left(), fieldMetadata)); - } - @Test void testGetEnumOptionByValueIgnoringSpaces() { FieldMetadata fieldMetadata = ConverterTestUtils.getWorkItemCustomField(); diff --git a/app/src/test/java/ch/sbb/polarion/extension/generic/service/PolarionServiceTest.java b/app/src/test/java/ch/sbb/polarion/extension/generic/service/PolarionServiceTest.java index 8832d06..b0ae9c8 100644 --- a/app/src/test/java/ch/sbb/polarion/extension/generic/service/PolarionServiceTest.java +++ b/app/src/test/java/ch/sbb/polarion/extension/generic/service/PolarionServiceTest.java @@ -243,11 +243,11 @@ void testGetCollectionWithRevision() { @Test void testGetGeneralFields() { - IDataService dataService = mock(IDataService.class); - when(trackerService.getDataService()).thenReturn(dataService); + IDataService mockDataService = mock(IDataService.class); + when(trackerService.getDataService()).thenReturn(mockDataService); IPrototype prototype = mock(IPrototype.class); when(prototype.getKeyNames()).thenReturn(List.of("key1", "key2", "key3")); - when(dataService.getPrototype(anyString())).thenReturn(prototype); + when(mockDataService.getPrototype(anyString())).thenReturn(prototype); FieldMetadata metadata1 = FieldMetadata.builder().id("id1").build(); FieldMetadata metadata2 = FieldMetadata.builder().id("id2").build(); @@ -263,14 +263,14 @@ void testGetGeneralFields() { @Test void testGetCustomFields() { - IDataService dataService = mock(IDataService.class); - when(trackerService.getDataService()).thenReturn(dataService); + IDataService mockDataService = mock(IDataService.class); + when(trackerService.getDataService()).thenReturn(mockDataService); ICustomFieldsService customFieldsService = mock(ICustomFieldsService.class); ICustomField customField1 = mock(ICustomField.class); ICustomField customField2 = mock(ICustomField.class); ICustomField customField3 = mock(ICustomField.class); when(customFieldsService.getCustomFields(anyString(), any(), anyString())).thenReturn(List.of(customField1, customField2, customField3)); - when(dataService.getCustomFieldsService()).thenReturn(customFieldsService); + when(mockDataService.getCustomFieldsService()).thenReturn(customFieldsService); FieldMetadata metadata1 = FieldMetadata.builder().id("id1").build(); FieldMetadata metadata2 = FieldMetadata.builder().id("id2").build(); @@ -407,10 +407,10 @@ void testGetOptionsForEnum() { void testGetEnumeration() { when(polarionService.getEnumeration(any(), any())).thenCallRealMethod(); - IDataService dataService = mock(IDataService.class); - when(trackerService.getDataService()).thenReturn(dataService); + IDataService mockDataService = mock(IDataService.class); + when(trackerService.getDataService()).thenReturn(mockDataService); IEnumeration enumeration = mock(IEnumeration.class); - when(dataService.getEnumerationForEnumId(any(), any())).thenReturn(enumeration); + when(mockDataService.getEnumerationForEnumId(any(), any())).thenReturn(enumeration); assertSame(enumeration, polarionService.getEnumeration(mock(IEnumType.class), mock(IContextId.class))); } diff --git a/app/src/test/java/ch/sbb/polarion/extension/generic/settings/TestSettingsModel.java b/app/src/test/java/ch/sbb/polarion/extension/generic/settings/TestSettingsModel.java index 59fa660..10ae790 100644 --- a/app/src/test/java/ch/sbb/polarion/extension/generic/settings/TestSettingsModel.java +++ b/app/src/test/java/ch/sbb/polarion/extension/generic/settings/TestSettingsModel.java @@ -9,6 +9,6 @@ protected String serializeModelData() { @Override protected void deserializeModelData(String serializedString) { - + // do nothing } } diff --git a/app/src/test/java/ch/sbb/polarion/extension/generic/util/PObjectListStub.java b/app/src/test/java/ch/sbb/polarion/extension/generic/util/PObjectListStub.java index c8ddf52..2d3c772 100644 --- a/app/src/test/java/ch/sbb/polarion/extension/generic/util/PObjectListStub.java +++ b/app/src/test/java/ch/sbb/polarion/extension/generic/util/PObjectListStub.java @@ -31,14 +31,17 @@ public IDataService getDataService() { @Override public void resolveAll() { + // do nothing } @Override - public void resolveFirst(int i) { + public void resolveFirst(int n) { + // do nothing } @Override - public void resolve(int i, int i1) { + public void resolve(int first, int length) { + // do nothing } @Override