Skip to content

Commit 7326c4a

Browse files
committed
continue building IT test
1 parent 6d7023b commit 7326c4a

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

lightblue-ldap-integration-test/src/test/java/com/redhat/lightblue/crud/ldap/ITCaseLdapCRUDControllerTest.java

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
import java.io.IOException;
2525

26-
import org.junit.After;
27-
import org.junit.Before;
28-
import org.junit.Rule;
26+
import org.junit.AfterClass;
27+
import org.junit.BeforeClass;
28+
import org.junit.ClassRule;
2929
import org.junit.Test;
3030

3131
import com.redhat.lightblue.DataError;
@@ -46,32 +46,30 @@
4646
@InMemoryMongoServer
4747
public class ITCaseLdapCRUDControllerTest{
4848

49-
@Rule
50-
public LdapServerExternalResource ldapServer = LdapServerExternalResource.createDefaultInstance();
49+
@ClassRule
50+
public static LdapServerExternalResource ldapServer = LdapServerExternalResource.createDefaultInstance();
5151

52-
@Rule
53-
public MongoServerExternalResource mongoServer = new MongoServerExternalResource();
52+
@ClassRule
53+
public static MongoServerExternalResource mongoServer = new MongoServerExternalResource();
5454

55-
@Before
56-
public void before() throws IOException {
57-
lightblueFactory = new LightblueFactory(
58-
new DataSourcesConfiguration(AbstractJsonNodeTest.loadJsonNode("./datasources.json")));
59-
}
60-
61-
@After
62-
public void after(){
63-
lightblueFactory = null;
64-
}
55+
public static LightblueFactory lightblueFactory;
6556

66-
public ITCaseLdapCRUDControllerTest(){
57+
@BeforeClass
58+
public static void beforeClass() throws IOException {
6759
System.setProperty("ldap.host", "localhost");
6860
System.setProperty("ldap.port", String.valueOf(LdapServerExternalResource.DEFAULT_PORT));
6961

7062
System.setProperty("mongo.host", "localhost");
7163
System.setProperty("mongo.port", String.valueOf(MongoServerExternalResource.DEFAULT_PORT));
64+
65+
lightblueFactory = new LightblueFactory(
66+
new DataSourcesConfiguration(AbstractJsonNodeTest.loadJsonNode("./datasources.json")));
7267
}
7368

74-
public LightblueFactory lightblueFactory;
69+
@AfterClass
70+
public static void after(){
71+
lightblueFactory = null;
72+
}
7573

7674
@Test
7775
public void testInsert() throws Exception{

0 commit comments

Comments
 (0)