Beispiel #1
0
  @Test
  public void shouldDeleteAnEnvironment() throws Exception {
    String environmentName = "dev";
    HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
    goConfigService.addEnvironment(
        new BasicEnvironmentConfig(new CaseInsensitiveString(environmentName)));

    assertTrue(goConfigService.hasEnvironmentNamed(new CaseInsensitiveString(environmentName)));
    service.deleteEnvironment(
        service.getEnvironmentConfig(environmentName),
        new Username(new CaseInsensitiveString("foo")),
        result);
    assertFalse(goConfigService.hasEnvironmentNamed(new CaseInsensitiveString(environmentName)));
    assertThat(
        result.message(localizer), containsString("Environment 'dev' was deleted successfully."));
  }