Skip to content

Commit

Permalink
gh-2435 persistent table on github
Browse files Browse the repository at this point in the history
  • Loading branch information
GCHQDev404 committed Jun 11, 2021
1 parent 4ce89ac commit 99d070a
Showing 1 changed file with 12 additions and 6 deletions.
Expand Up @@ -43,6 +43,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Map;
import java.util.Random;
import java.util.Set;

import static org.junit.Assert.assertArrayEquals;
Expand Down Expand Up @@ -443,8 +444,17 @@ public void shouldNotChangeGraphUserFromSomeoneElseToReplacementUserAsNonAdminWh
@Test
public void shouldChangeGraphIdForOwnGraph() throws Exception {
//given
final String graphA = "graphTableA";
final String graphB = "graphTableB";
Random random = new Random(); //This is a hack, a state isn't being cleared somewhere.
final String graphA = "graphTableA_" + random.nextInt();
final String graphB = "graphTableB_" + random.nextInt();
Connector connector = TableUtils.getConnector(ACCUMULO_PROPERTIES.getInstance(),
ACCUMULO_PROPERTIES.getZookeepers(),
ACCUMULO_PROPERTIES.getUser(),
ACCUMULO_PROPERTIES.getPassword());

connector.tableOperations().delete(graphA);
connector.tableOperations().delete(graphB);

graph.execute(new AddGraph.Builder()
.graphId(graphA)
.schema(new Schema())
Expand All @@ -453,10 +463,6 @@ public void shouldChangeGraphIdForOwnGraph() throws Exception {
.build(), user);
assertTrue(Lists.newArrayList(graph.execute(new GetAllGraphIds(), user)).contains(graphA));

Connector connector = TableUtils.getConnector(ACCUMULO_PROPERTIES.getInstance(),
ACCUMULO_PROPERTIES.getZookeepers(),
ACCUMULO_PROPERTIES.getUser(),
ACCUMULO_PROPERTIES.getPassword());

//when
boolean tableGraphABefore = connector.tableOperations().exists(graphA);
Expand Down

0 comments on commit 99d070a

Please sign in to comment.