@Test
public void testDoRampActions() throws ExecutorManagerException {

  List<Map<String, Object>> actions = ImmutableList.<Map<String, Object>>builder()
      .add(ImmutableMap.<String, Object>builder()
          .put("action", "insert")
          .put("table", "ramp")
          .put("values", ImmutableMap.<String, Object>builder()
              .put("rampId", "dali")
              .put("rampPolicy", "SimpleAutoRampPolicy")
              .build())
          .build())
      .add(ImmutableMap.<String, Object>builder()
          .put("action", "insert")
          .put("table", "ramp_items")
          .put("values", ImmutableMap.<String, Object>builder()
              .put("rampId", "dali")
              .put("dependency", "jar:dali-data-pig")
              .put("rampValue", "/export/apps/dali/pig/dali-data-pig-9.2.10.jar")
              .build())
          .build())
      .build();
  Map<String, String> results = this.executionRampDao.doRampActions(actions);
  results.forEach((k, v) -> assertThat(v.startsWith("[SUCCESS]")).isTrue());
  final ExecutableRampMap ramps =
      this.executionRampDao.fetchExecutableRampMap();
  assertThat(ramps.get("dali").isActive()).isFalse();
  assertThat(ramps.get("dali").getPolicy()).isEqualTo("SimpleAutoRampPolicy");
  assertThat(ramps.get("dali").getMaxFailureToRampDown()).isZero();
  assertThat(ramps.get("dali").getMaxFailureToPause()).isZero();
  assertThat(ramps.get("dali").isPercentageScaleForMaxFailure()).isFalse();
  assertThat(ramps.get("dali").getStage()).isZero();
  assertThat(ramps.get("dali").getStartTime()).isNotZero();
  assertThat(ramps.get("dali").getEndTime()).isZero();
  assertThat(ramps.get("dali").getLastUpdatedTime()).isZero();
  assertThat(ramps.get("dali").getCount(ExecutableRamp.CountType.FAILURE)).isZero();
  assertThat(ramps.get("dali").getCount(ExecutableRamp.CountType.SUCCESS)).isZero();
  assertThat(ramps.get("dali").getCount(ExecutableRamp.CountType.TRAIL)).isZero();
  assertThat(ramps.get("dali").isPaused()).isFalse();
  assertThat(ramps.size()).isEqualTo(1);
  final ExecutableRampItemsMap rampItems = this.executionRampDao.fetchExecutableRampItemsMap();
  assertThat(rampItems.getRampItems("dali").get("jar:dali-data-pig"))
      .isEqualToIgnoringWhitespace("/export/apps/dali/pig/dali-data-pig-9.2.10.jar");
  assertThat(rampItems.size()).isEqualTo(1);
}