|
| 1 | +package apoc.monitor; |
| 2 | + |
| 3 | +import apoc.util.Neo4jContainerExtension; |
| 4 | +import apoc.util.TestContainerUtil; |
| 5 | +import org.junit.AfterClass; |
| 6 | +import org.junit.BeforeClass; |
| 7 | +import org.junit.Test; |
| 8 | + |
| 9 | +import org.neo4j.driver.Session; |
| 10 | + |
| 11 | +import java.util.List; |
| 12 | + |
| 13 | +import static apoc.util.TestContainerUtil.createEnterpriseDB; |
| 14 | +import static apoc.util.TestContainerUtil.testCall; |
| 15 | +import static org.junit.Assert.assertNotNull; |
| 16 | + |
| 17 | +public class StoreInfoProcedureEnterpriseTest { |
| 18 | + private static Neo4jContainerExtension neo4jContainer; |
| 19 | + private static Session session; |
| 20 | + |
| 21 | + @BeforeClass |
| 22 | + public static void setUp() throws Exception { |
| 23 | + neo4jContainer = createEnterpriseDB(List.of(TestContainerUtil.ApocPackage.EXTENDED), true); |
| 24 | + neo4jContainer.start(); |
| 25 | + |
| 26 | + session = neo4jContainer.getSession(); |
| 27 | + } |
| 28 | + |
| 29 | + @AfterClass |
| 30 | + public static void tearDown() { |
| 31 | + session.close(); |
| 32 | + neo4jContainer.close(); |
| 33 | + } |
| 34 | + |
| 35 | + @Test |
| 36 | + public void testGetStoreInfo() { |
| 37 | + testCall(session, "CALL apoc.monitor.store()", (row) -> { |
| 38 | + assertNotNull(row.get("logSize")); |
| 39 | + assertNotNull(row.get("stringStoreSize")); |
| 40 | + assertNotNull(row.get("arrayStoreSize")); |
| 41 | + assertNotNull(row.get("nodeStoreSize")); |
| 42 | + assertNotNull(row.get("relStoreSize")); |
| 43 | + assertNotNull(row.get("propStoreSize")); |
| 44 | + assertNotNull(row.get("totalStoreSize")); |
| 45 | + }); |
| 46 | + } |
| 47 | +} |
0 commit comments