Skip to content

Commit

Permalink
Restructured and added a mapping test
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Sep 22, 2024
1 parent 596d2c4 commit 2c6a62d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
6 changes: 6 additions & 0 deletions org.bridgedb.webservice.bridgerest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
<version>${project.parent.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bridgedb</groupId>
<artifactId>org.bridgedb.bio</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,36 @@
//
package org.bridgedb.webservice.bridgerest;

import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import java.util.Set;

import org.bridgedb.DataSource;
import org.bridgedb.IDMapperException;
import org.bridgedb.Xref;
import org.bridgedb.bio.DataSourceTxt;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

public class BridgeRestTest {

private static BridgeRest service;

@BeforeAll
public static void init() {

public static void init() throws IDMapperException {
if (DataSource.getDataSources().size() == 0) DataSourceTxt.init();
BridgeRestTest.service = new BridgeRest("https://webservice.bridgedb.org/Human");
assertNotNull(service);
assertTrue(service.isConnected());
}

@Test
public void test() throws IDMapperException {
BridgeRest service = new BridgeRest("https://webservice.bridgedb.org/Human");
public void testMap() throws IDMapperException {
assertNotNull(service);
assertTrue(service.isConnected());
Set<Xref> mappings = service.mapID(new Xref("CHEBI:123", DataSource.getExistingBySystemCode("Ce")));
assertNotSame(0, mappings.size());
}
}

0 comments on commit 2c6a62d

Please sign in to comment.