use of org.eclipse.che.api.workspace.server.model.impl.WarningImpl in project devspaces-images by redhat-developer.
the class SecureServerExposerFactoryProviderTest method shouldAddWarningIfSecureServerConfiguredInEnvironmentWasNotFound.
@Test
public void shouldAddWarningIfSecureServerConfiguredInEnvironmentWasNotFound() {
// given
SecureServerExposerFactoryProvider<KubernetesEnvironment> factoryProvider = new SecureServerExposerFactoryProvider<>(EXPOSER1, factories);
kubernetesEnvironment.setAttributes(ImmutableMap.of(SECURE_EXPOSER_IMPL_PROPERTY, NON_EXISTING_EXPOSER));
WarningImpl expectedWarning = new WarningImpl(UNKNOWN_SECURE_SERVER_EXPOSER_CONFIGURED_IN_WS_WARNING_CODE, format(UNKNOWN_EXPOSER_ERROR_TEMPLATE, NON_EXISTING_EXPOSER, String.join(", ", factories.keySet())));
SecureServerExposerFactory<KubernetesEnvironment> factory = factoryProvider.get(kubernetesEnvironment);
// then
assertSame(factory, secureServerExposer1);
assertEquals(kubernetesEnvironment.getWarnings().size(), 1);
assertEquals(kubernetesEnvironment.getWarnings().get(0), expectedWarning);
}
Aggregations