From b3f02a0be02939a07e83ce3990889179a1c3eda3 Mon Sep 17 00:00:00 2001 From: TheOtherP Date: Sat, 6 Apr 2024 15:16:29 +0200 Subject: [PATCH] Fix IndexerWebAccessTest --- .../org/nzbhydra/indexers/IndexerWebAccessTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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);