diff --git a/core/src/test/java/org/nzbhydra/indexers/IndexerWebAccessTest.java b/core/src/test/java/org/nzbhydra/indexers/IndexerWebAccessTest.java index c6f7e9d95..a5397727e 100644 --- a/core/src/test/java/org/nzbhydra/indexers/IndexerWebAccessTest.java +++ b/core/src/test/java/org/nzbhydra/indexers/IndexerWebAccessTest.java @@ -33,7 +33,7 @@ public class IndexerWebAccessTest { private ConfigProvider configProviderMock; @Mock private WebAccess webAccessMock; - private IndexerConfig indexerConfig = new IndexerConfig(); + private final IndexerConfig indexerConfig = new IndexerConfig(); @Mock private Unmarshaller unmarshallerMock; @Captor @@ -46,10 +46,11 @@ public class IndexerWebAccessTest { @BeforeEach public void setUp() throws Exception { - MockitoAnnotations.initMocks(this); - String xml = "\n" + - "\n" + - ""; + MockitoAnnotations.openMocks(this); + String xml = """ + \ + + """; when(webAccessMock.callUrl(anyString(), headersCaptor.capture(), timeoutCaptor.capture())).thenReturn(xml); BaseConfig baseConfig = new BaseConfig(); baseConfig.setSearching(searchingConfigMock);