Rollover extends GenericResultAbstractAction { @Override public String getRestMethodName() { return "POST"; } protected  Rollover(Rollover.Builder builder); @Override String getRestMethodName();  }
@Test public void testBasicUriGeneration() { Rollover rollover = new Rollover.Builder("twitter").conditions(rolloverConditions).build(); assertEquals("POST", rollover.getRestMethodName()); assertEquals("twitter/_rollover", rollover.getURI(ElasticsearchVersion.UNKNOWN)); assertEquals("{\"conditions\":{\"max_age\":\"1d\",\"max_docs\":\"10000\"}}", rollover.getData(new Gson())); }
@Test public void testBasicUriWithSettingsGeneration() { Rollover rollover = new Rollover.Builder("twitter").conditions(rolloverConditions).settings(rolloverSettings).build(); assertEquals("POST", rollover.getRestMethodName()); assertEquals("twitter/_rollover", rollover.getURI(ElasticsearchVersion.UNKNOWN)); assertEquals("{\"settings\":{\"index.number_of_shards\":\"2\"},\"conditions\":{\"max_age\":\"1d\",\"max_docs\":\"10000\"}}", rollover.getData(new Gson())); }
@Test public void testDryRunUriGeneration() { Rollover rollover = new Rollover.Builder("twitter").conditions(rolloverConditions).setDryRun(true).build(); assertEquals("POST", rollover.getRestMethodName()); assertEquals("twitter/_rollover?dry_run", rollover.getURI(ElasticsearchVersion.UNKNOWN)); }