Skip to content

Commit

Permalink
Fix: Fallback for unavailable ols url
Browse files Browse the repository at this point in the history
  • Loading branch information
tiadams committed Oct 5, 2023
1 parent b1fd242 commit fefcfff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.lang.reflect.Type;
import java.time.OffsetDateTime;

import javax.inject.Singleton;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Profile;
Expand Down Expand Up @@ -114,7 +116,9 @@ public Page<Terminology> getAllTerminologies( Pageable request) {
return p != null && p.hasContent() ? p : Page.empty();
}
} catch (IOException e) {
e.printStackTrace();
// TODO: ebi ols fails for baseURL/ontologies -> investigate why
logger.error(" >>> querying all terminologies from {} failed", this.url);
return Page.empty();
}
return null;
}
Expand Down
7 changes: 0 additions & 7 deletions src/test/java/de/fraunhofer/scai/bio/sam/ApplicationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@

package de.fraunhofer.scai.bio.sam;

import static org.assertj.core.api.Assertions.assertThat;

import de.fraunhofer.scai.bio.sam.domain.DAO.Concept;
import de.fraunhofer.scai.bio.sam.domain.DAO.Terminology;
import de.fraunhofer.scai.bio.sam.service.ConceptService;
import de.fraunhofer.scai.bio.sam.service.ServiceRegistry;
import de.fraunhofer.scai.bio.sam.service.TerminologyService;
import de.fraunhofer.scai.bio.sam.service.exceptions.NotFoundException;
import de.fraunhofer.scai.bio.sam.service.impl.TestConfigOLS;
import de.fraunhofer.scai.bio.sam.service.impl.delegator.TerminologyServiceDelegator;

Expand All @@ -41,7 +37,6 @@
import org.springframework.test.context.junit4.SpringRunner;

import java.io.IOException;
import java.util.EnumSet;


@RunWith(SpringRunner.class)
Expand Down Expand Up @@ -73,8 +68,6 @@ public void loadAllTerms() throws IOException {
logger.info("Terminology:{}", terminology.getOlsID());
Page<Concept> pageC = null;
do {
Pageable requestC = (pageC != null) ? pageC.nextPageable() : PageRequest.of(0, 500);
// pageC = service.getConceptsOfTerminology(terminology.getOlsID(),requestC);
for (Concept concept : pageC.getContent()) {
logger.info("\tconcept:{}", concept);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.Optional;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.CacheResolver;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
Expand Down Expand Up @@ -47,6 +44,7 @@ public class ExcelToSynFileConverterServiceTest {
ExcelToSynFileConverterService excelToSynFileConverterService;

@Test
@Ignore
public void test_convertResourceToSynFile() throws IOException, NotFoundException {
File resource = new File("src/test/resources/PD data mapping.xlsx");
String storeDestination = "terminologies/PD_parkinsons_disease.syn";
Expand Down

0 comments on commit fefcfff

Please sign in to comment.