Browse code

Fix CalendarsMgmtTests.testDelete_Domain

Nicolas Lascombes authored on 10/10/2018 16:54:38
Showing 1 changed files
... ...
@@ -44,7 +44,6 @@ import net.bluemind.core.container.persistance.ContainerStore;
44 44
 import net.bluemind.core.container.persistance.DataSourceRouter;
45 45
 import net.bluemind.core.context.SecurityContext;
46 46
 import net.bluemind.core.elasticsearch.ElasticsearchTestHelper;
47
-import net.bluemind.core.jdbc.JdbcActivator;
48 47
 import net.bluemind.core.jdbc.JdbcTestHelper;
49 48
 import net.bluemind.core.rest.ServerSideServiceProvider;
50 49
 import net.bluemind.core.sessions.Sessions;
... ...
@@ -52,7 +51,6 @@ import net.bluemind.core.tests.BmTestContext;
52 52
 import net.bluemind.directory.api.DirEntry;
53 53
 import net.bluemind.directory.api.IDirectory;
54 54
 import net.bluemind.lib.vertx.VertxPlatform;
55
-import net.bluemind.pool.impl.BmConfIni;
56 55
 import net.bluemind.server.api.Server;
57 56
 import net.bluemind.tests.defaultdata.PopulateHelper;
58 57
 
... ...
@@ -68,7 +66,7 @@ public class CalendarsMgmtTests {
68 68
 	public void before() throws Exception {
69 69
 
70 70
 		JdbcTestHelper.getInstance().beforeTest();
71
-		
71
+
72 72
 		ElasticsearchTestHelper.getInstance().beforeTest();
73 73
 		Server esServer = new Server();
74 74
 		esServer.ip = ElasticsearchTestHelper.getInstance().getHost();
... ...
@@ -140,7 +138,9 @@ public class CalendarsMgmtTests {
140 140
 		service.create(calUid, CalendarDescriptor.create("test", domainUid, domainUid));
141 141
 
142 142
 		service.delete(calUid);
143
-		ContainerStore cs = new ContainerStore(JdbcActivator.getInstance().getDataSource(), domainAdmin);
143
+
144
+		DataSource ds = DataSourceRouter.get(testContext, calUid);
145
+		ContainerStore cs = new ContainerStore(testContext, ds, domainAdmin);
144 146
 		assertNull(cs.get(calUid));
145 147
 
146 148
 		// dummy cannot do it
... ...
@@ -155,7 +155,9 @@ public class CalendarsMgmtTests {
155 155
 		} catch (ServerFault e) {
156 156
 			assertEquals(ErrorCode.PERMISSION_DENIED, e.getCode());
157 157
 		}
158
-		cs = new ContainerStore(JdbcActivator.getInstance().getDataSource(), domainAdmin);
158
+
159
+		ds = DataSourceRouter.get(testContext, calUid);
160
+		cs = new ContainerStore(testContext, ds, domainAdmin);
159 161
 		assertNotNull(cs.get(calUid));
160 162
 
161 163
 	}
... ...
@@ -199,7 +201,7 @@ public class CalendarsMgmtTests {
199 199
 
200 200
 		service.delete(calUid);
201 201
 		DataSource ds = DataSourceRouter.get(testContext, calUid);
202
-		ContainerStore cs = new ContainerStore(ds, domainAdmin);
202
+		ContainerStore cs = new ContainerStore(testContext, ds, domainAdmin);
203 203
 		assertNull(cs.get(calUid));
204 204
 
205 205
 		// dummy2 cannot do it