### Question:
EnsureOakIndexJobHandler implements Runnable { public void disableIndex(@Nonnull Resource oakIndex) throws PersistenceException { final ModifiableValueMap oakIndexProperties = oakIndex.adaptTo(ModifiableValueMap.class); oakIndexProperties.put(PN_TYPE, DISABLED); log.info("Disabled index at {}", oakIndex.getPath()); } EnsureOakIndexJobHandler(EnsureOakIndex ensureOakIndex, String oakIndexPath, String ensureDefinitionsPath); @Override @SuppressWarnings("squid:S1141") void run(); void forceRefresh(final @Nonnull Resource oakIndex); Resource create(final @Nonnull Resource ensuredDefinition, final @Nonnull Resource oakIndexes); @SuppressWarnings("squid:S3776") Resource update(final @Nonnull Resource ensureDefinition, final @Nonnull Resource oakIndexes, boolean forceReindex); void disableIndex(@Nonnull Resource oakIndex); void delete(final @Nonnull Resource oakIndex); void validateEnsureDefinition(@Nonnull Resource ensureDefinition);  }### Answer:
@Test public void testDisableIndex() { ensureIndexProperties.put(EnsureOakIndexJobHandler.PN_DISABLE, "true"); context.build().resource(ENSURE_INDEX_PATH, ensureIndexProperties).commit(); context.build().resource(OAK_INDEX_PATH, oakIndexProperties).commit(); handler.run(); Resource indexResource = context.resourceResolver().getResource(OAK_INDEX_PATH); assertNotNull("Index does not exist anymore",indexResource); ValueMap vm = indexResource.adaptTo(ValueMap.class); assertNotNull(vm); assertEquals("disabled",vm.get("type",String.class)); }