ProvisionrSupport implements Provisionr { protected String convertTimeoutToISO8601TimeDuration(int bootstrapTimeoutInSeconds) { StringBuilder result = new StringBuilder("PT"); if (bootstrapTimeoutInSeconds % 60 == 0) { result.append(bootstrapTimeoutInSeconds / 60).append("M"); } else { result.append(bootstrapTimeoutInSeconds).append("S"); } return result.toString(); }  @Override Optional<Provider> getDefaultProvider(); @Override String getStatus(String businessKey); @Override List<Machine> getMachines(String businessKey);  }
@Test public void testConvertTimeout() { ProvisionrSupport provisionr = new ProvisionrSupportTestable(); assertThat(provisionr.convertTimeoutToISO8601TimeDuration(600)).isEqualTo("PT10M"); assertThat(provisionr.convertTimeoutToISO8601TimeDuration(601)).isEqualTo("PT601S"); assertThat(provisionr.convertTimeoutToISO8601TimeDuration(300)).isEqualTo("PT5M"); assertThat(provisionr.convertTimeoutToISO8601TimeDuration(42)).isEqualTo("PT42S"); }