From 1451e6bc71e48f6c761cd031480a506266223d46 Mon Sep 17 00:00:00 2001 From: nkumar2 Date: Tue, 23 Jan 2024 15:02:50 +0000 Subject: [PATCH] removing retry test --- .../eva/contigalias/datasource/RetryTest.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/test/java/uk/ac/ebi/eva/contigalias/datasource/RetryTest.java b/src/test/java/uk/ac/ebi/eva/contigalias/datasource/RetryTest.java index 8c8440df..79ee4bb8 100644 --- a/src/test/java/uk/ac/ebi/eva/contigalias/datasource/RetryTest.java +++ b/src/test/java/uk/ac/ebi/eva/contigalias/datasource/RetryTest.java @@ -1,6 +1,5 @@ package uk.ac.ebi.eva.contigalias.datasource; -import com.fasterxml.jackson.databind.JsonNode; import org.apache.commons.net.ftp.FTPFile; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; @@ -8,13 +7,10 @@ import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.retry.annotation.EnableRetry; import org.springframework.test.context.TestPropertySource; -import org.springframework.web.client.RestTemplate; import uk.ac.ebi.eva.contigalias.dus.NCBIBrowser; import uk.ac.ebi.eva.contigalias.exception.DownloadFailedException; -import uk.ac.ebi.eva.contigalias.scheduler.Md5ChecksumRetriever; import java.io.IOException; import java.nio.file.Path; @@ -24,8 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -44,13 +38,6 @@ public class RetryTest { @Autowired private NCBIAssemblyDataSource dataSource; - @Autowired - private Md5ChecksumRetriever md5ChecksumRetriever; - - @MockBean - private RestTemplate restTemplate; - - @Test public void fileDownloadSuccessfulTest() throws IOException { String mockAccession = "GCA_000012345.1"; @@ -120,20 +107,4 @@ public void fileDownloadFailedRetryTest2() throws IOException { verify(ncbiBrowser, times(5)).getGenomeReportDirectory(mockAccession); } - - @Test - public void retrieveMd5ChecksumRetry() { - String insdcAccession = "TEST_ACCESSION"; - when(restTemplate.getForObject(anyString(), eq(JsonNode.class))) - .thenThrow(new RuntimeException("Simulated network issue")); - - Md5ChecksumRetriever anotherObjSpy = Mockito.spy(md5ChecksumRetriever); - RuntimeException thrown = Assertions.assertThrows(RuntimeException.class, () -> { - anotherObjSpy.retrieveMd5Checksum(insdcAccession); - }); - - assertEquals("Simulated network issue", thrown.getMessage()); - verify(restTemplate, times(5)).getForObject(anyString(), eq(JsonNode.class)); - } - }