TenantBuilder { public PowerTenant build(boolean enableDryRun) { if (secrets == null) { throw new IllegalStateException("Secret provider must be provided."); } var apiProvider = api == null ? new ApiProvider() : api; var tokenSupplier = new ZonkyApiTokenSupplier(apiProvider, secrets); return new PowerTenantImpl(secrets.getUsername(), name, enableDryRun, apiProvider, strategyProvider, tokenSupplier); }  TenantBuilder withSecrets(final SecretProvider secrets); TenantBuilder withStrategy(final String strategyLocation); TenantBuilder named(final String name); TenantBuilder withApi(final ApiProvider api); PowerTenant build(boolean enableDryRun);  }
@Test void secretsNotProvided() { assertThatThrownBy(() -> new TenantBuilder().build(false)).isInstanceOf(IllegalStateException.class); }