Skip to content

Commit 2c6a62d

Browse files
committed
Restructured and added a mapping test
1 parent 596d2c4 commit 2c6a62d

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

org.bridgedb.webservice.bridgerest/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080
<version>${project.parent.version}</version>
8181
<scope>compile</scope>
8282
</dependency>
83+
<dependency>
84+
<groupId>org.bridgedb</groupId>
85+
<artifactId>org.bridgedb.bio</artifactId>
86+
<version>${project.parent.version}</version>
87+
<scope>test</scope>
88+
</dependency>
8389
<dependency>
8490
<groupId>org.junit.platform</groupId>
8591
<artifactId>junit-platform-surefire-provider</artifactId>

org.bridgedb.webservice.bridgerest/src/test/java/org/bridgedb/webservice/bridgerest/BridgeRestTest.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,36 @@
1414
//
1515
package org.bridgedb.webservice.bridgerest;
1616

17+
import static org.junit.Assert.assertNotSame;
18+
import static org.junit.Assert.assertTrue;
1719
import static org.junit.jupiter.api.Assertions.assertNotNull;
1820

21+
import java.util.Set;
22+
23+
import org.bridgedb.DataSource;
1924
import org.bridgedb.IDMapperException;
25+
import org.bridgedb.Xref;
26+
import org.bridgedb.bio.DataSourceTxt;
2027
import org.junit.jupiter.api.BeforeAll;
2128
import org.junit.jupiter.api.Test;
2229

2330
public class BridgeRestTest {
2431

32+
private static BridgeRest service;
33+
2534
@BeforeAll
26-
public static void init() {
27-
35+
public static void init() throws IDMapperException {
36+
if (DataSource.getDataSources().size() == 0) DataSourceTxt.init();
37+
BridgeRestTest.service = new BridgeRest("https://webservice.bridgedb.org/Human");
38+
assertNotNull(service);
39+
assertTrue(service.isConnected());
2840
}
2941

3042
@Test
31-
public void test() throws IDMapperException {
32-
BridgeRest service = new BridgeRest("https://webservice.bridgedb.org/Human");
43+
public void testMap() throws IDMapperException {
3344
assertNotNull(service);
45+
assertTrue(service.isConnected());
46+
Set<Xref> mappings = service.mapID(new Xref("CHEBI:123", DataSource.getExistingBySystemCode("Ce")));
47+
assertNotSame(0, mappings.size());
3448
}
3549
}

0 commit comments

Comments
 (0)