Fix test properties
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -9,11 +9,13 @@
|
||||
package org.eclipse.hawkbit;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Properties for the server e.g. the server's URL which must be configured.
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties("hawkbit.server")
|
||||
public class HawkbitServerProperties {
|
||||
/**
|
||||
|
||||
@@ -29,6 +29,8 @@ public class TenantConfigurationPollingDurationValidator implements TenantConfig
|
||||
private final Duration maxDuration;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param properties
|
||||
* property accessor for poll configuration
|
||||
*/
|
||||
@@ -46,7 +48,6 @@ public class TenantConfigurationPollingDurationValidator implements TenantConfig
|
||||
final Duration tenantConfigurationValue;
|
||||
try {
|
||||
tenantConfigurationValue = durationHelper.formattedStringToDuration(tenantConfigurationString);
|
||||
|
||||
} catch (final DateTimeParseException ex) {
|
||||
throw new TenantConfigurationValidatorException(
|
||||
String.format("The given configuration value is expected as a string in the format %s.",
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.eclipse.hawkbit.repository.model.TenantConfigurationValue;
|
||||
import org.eclipse.hawkbit.security.DdiSecurityProperties;
|
||||
import org.eclipse.hawkbit.security.DdiSecurityProperties.Rp;
|
||||
import org.eclipse.hawkbit.security.SecurityContextTenantAware;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -93,7 +94,10 @@ public class AmqpControllerAuthenticationTest {
|
||||
authenticationManager.setControllerManagement(controllerManagement);
|
||||
amqpMessageHandlerService.setArtifactManagement(mock(ArtifactManagement.class));
|
||||
|
||||
authenticationManager.setTenantAware(new SecurityContextTenantAware());
|
||||
final SecurityContextTenantAware tenantAware = new SecurityContextTenantAware();
|
||||
authenticationManager.setTenantAware(tenantAware);
|
||||
final SystemSecurityContext systemSecurityContext = new SystemSecurityContext(tenantAware);
|
||||
authenticationManager.setSystemSecurityContext(systemSecurityContext);
|
||||
authenticationManager.postConstruct();
|
||||
amqpMessageHandlerService.setAuthenticationManager(authenticationManager);
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@ public class HttpControllerPreAuthenticatedGatewaySecurityTokenFilter
|
||||
* @param tenantConfigurationManagement
|
||||
* the system management service to retrieve configuration
|
||||
* properties
|
||||
* @param systemManagement
|
||||
* the system management service to retrieve configuration
|
||||
* properties
|
||||
* @param tenantAware
|
||||
* the tenant aware service to get configuration for the specific
|
||||
* tenant
|
||||
|
||||
@@ -47,7 +47,7 @@ import com.mongodb.MongoClientOptions;
|
||||
*/
|
||||
@Configuration
|
||||
@EnableGlobalMethodSecurity(prePostEnabled = true, mode = AdviceMode.ASPECTJ, proxyTargetClass = true, securedEnabled = true)
|
||||
@EnableConfigurationProperties({ DdiSecurityProperties.class, ControllerPollProperties.class })
|
||||
@EnableConfigurationProperties({ DdiSecurityProperties.class })
|
||||
@Profile("test")
|
||||
public class TestConfiguration implements AsyncConfigurer {
|
||||
|
||||
|
||||
@@ -59,15 +59,12 @@ public class DurationConfigField extends GridLayout implements ValueChangeListen
|
||||
if (event.getProperty() != checkBox) {
|
||||
return;
|
||||
}
|
||||
|
||||
durationField.setEnabled(checkBox.getValue());
|
||||
|
||||
if (!checkBox.getValue()) {
|
||||
durationField.setDuration(globalDuration);
|
||||
}
|
||||
|
||||
durationField.setEnabled(false);
|
||||
|
||||
notifyConfigurationChanged();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user