LifeCycleConfig { @Config("lifecycle.stop-traffic.delay") @ConfigDescription("Amount of time to wait on shutdown after remove from load balancers before stop taking requests") public LifeCycleConfig setStopTrafficDelay(Duration stopTrafficDelay) { this.stopTrafficDelay = stopTrafficDelay; return this; }  @Config("lifecycle.stop-traffic.delay") @ConfigDescription("Amount of time to wait on shutdown after remove from load balancers before stop taking requests") LifeCycleConfig setStopTrafficDelay(Duration stopTrafficDelay); Duration getStopTrafficDelay();  }
@Test public void testDefaults() { assertRecordedDefaults(recordDefaults(LifeCycleConfig.class) .setStopTrafficDelay(new Duration(0, TimeUnit.SECONDS))); }
@Test public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("lifecycle.stop-traffic.delay", "4s") .build(); LifeCycleConfig expected = new LifeCycleConfig() .setStopTrafficDelay(new Duration(4, TimeUnit.SECONDS)); assertFullMapping(properties, expected); }