.put("index.number_of_shards", "1")
.put("index.refresh_interval", "30s")
.put("action.auto_create_index", false)
- .put("index.mapper.dynamic", false);
+ .put("index.mapper.dynamic", false)
+ .put("action.auto_create_index", false);
}
private void configureCluster(Settings.Builder builder) {
.put("processors", 1)
.put("http.enabled", false)
.put("config.ignore_system_properties", true)
+ .put("action.auto_create_index", false)
.put("path.home", tmpDir))
.build();
node.start();
import org.sonar.api.utils.log.LogTester;
import org.sonar.api.utils.log.LoggerLevel;
import org.sonar.server.es.EsTester;
+import org.sonar.server.es.FakeIndexDefinition;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
public class ProxyDeleteRequestBuilderTest {
@ClassRule
- public static EsTester esTester = new EsTester();
+ public static EsTester esTester = new EsTester(new FakeIndexDefinition());
@Rule
public LogTester logTester = new LogTester();
@Test
public void commitAndIndex_keeps_elements_to_recover_in_ES_QUEUE_on_errors() {
ActiveRuleDto ar = db.qualityProfiles().activateRule(profile1, rule1);
- // force error by deleting the index
- deleteRulesIndex();
+ es.lockWrites(INDEX_TYPE_ACTIVE_RULE);
commitAndIndex(ar);
assertThat(es.countDocuments(INDEX_TYPE_ACTIVE_RULE)).isEqualTo(1);
}
-
- private void deleteRulesIndex() {
- es.deleteIndex(RuleIndexDefinition.INDEX_TYPE_RULE.getIndex());
- }
-
private void assertThatEsQueueTableIsEmpty() {
assertThat(db.countRowsOfTable(db.getSession(), "es_queue")).isEqualTo(0);
}