File tree Expand file tree Collapse file tree
org.bridgedb.webservice.bridgerest
src/test/java/org/bridgedb/webservice/bridgerest Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1414//
1515package org .bridgedb .webservice .bridgerest ;
1616
17+ import static org .junit .Assert .assertNotSame ;
18+ import static org .junit .Assert .assertTrue ;
1719import static org .junit .jupiter .api .Assertions .assertNotNull ;
1820
21+ import java .util .Set ;
22+
23+ import org .bridgedb .DataSource ;
1924import org .bridgedb .IDMapperException ;
25+ import org .bridgedb .Xref ;
26+ import org .bridgedb .bio .DataSourceTxt ;
2027import org .junit .jupiter .api .BeforeAll ;
2128import org .junit .jupiter .api .Test ;
2229
2330public 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}
You can’t perform that action at this time.
0 commit comments