|
23 | 23 |
|
24 | 24 | import java.io.IOException;
|
25 | 25 |
|
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; |
29 | 29 | import org.junit.Test;
|
30 | 30 |
|
31 | 31 | import com.redhat.lightblue.DataError;
|
|
46 | 46 | @InMemoryMongoServer
|
47 | 47 | public class ITCaseLdapCRUDControllerTest{
|
48 | 48 |
|
49 |
| - @Rule |
50 |
| - public LdapServerExternalResource ldapServer = LdapServerExternalResource.createDefaultInstance(); |
| 49 | + @ClassRule |
| 50 | + public static LdapServerExternalResource ldapServer = LdapServerExternalResource.createDefaultInstance(); |
51 | 51 |
|
52 |
| - @Rule |
53 |
| - public MongoServerExternalResource mongoServer = new MongoServerExternalResource(); |
| 52 | + @ClassRule |
| 53 | + public static MongoServerExternalResource mongoServer = new MongoServerExternalResource(); |
54 | 54 |
|
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; |
65 | 56 |
|
66 |
| - public ITCaseLdapCRUDControllerTest(){ |
| 57 | + @BeforeClass |
| 58 | + public static void beforeClass() throws IOException { |
67 | 59 | System.setProperty("ldap.host", "localhost");
|
68 | 60 | System.setProperty("ldap.port", String.valueOf(LdapServerExternalResource.DEFAULT_PORT));
|
69 | 61 |
|
70 | 62 | System.setProperty("mongo.host", "localhost");
|
71 | 63 | System.setProperty("mongo.port", String.valueOf(MongoServerExternalResource.DEFAULT_PORT));
|
| 64 | + |
| 65 | + lightblueFactory = new LightblueFactory( |
| 66 | + new DataSourcesConfiguration(AbstractJsonNodeTest.loadJsonNode("./datasources.json"))); |
72 | 67 | }
|
73 | 68 |
|
74 |
| - public LightblueFactory lightblueFactory; |
| 69 | + @AfterClass |
| 70 | + public static void after(){ |
| 71 | + lightblueFactory = null; |
| 72 | + } |
75 | 73 |
|
76 | 74 | @Test
|
77 | 75 | public void testInsert() throws Exception{
|
|
0 commit comments