Ejemplo n.º 1
0
  @Test
  public void shouldBringConstraintIndexOnlineWhenExplicitlyToldTo() throws Exception {
    // given
    IndexingService indexingService =
        newIndexingServiceWithMockedDependencies(populator, accessor, withData());

    life.start();

    // when
    indexingService.createIndex(
        IndexRule.constraintIndexRule(0, labelId, propertyKeyId, PROVIDER_DESCRIPTOR, null));
    IndexProxy proxy = indexingService.getProxyForRule(0);

    indexingService.activateIndex(0);

    // then
    assertEquals(ONLINE, proxy.getState());
    InOrder order = inOrder(populator, accessor);
    order.verify(populator).create();
    order.verify(populator).close(true);
  }