Bugfix: Setting and getting configuration values
- removed cache from global getter, because it was overriding the cache of the tenant specific getter - changed Type of AuthName key, type of key was not important before the huge configuration refactoring - fixed test conditions Signed-off-by: Nonnenmacher Fabian <fabian.nonnenmacher@bosch-si.com>
This commit is contained in:
committed by
Nonnenmacher Fabian
parent
6a88f2a3f4
commit
c39753001e
@@ -35,8 +35,8 @@ public enum TenantConfigurationKey {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME("authentication.header.authority",
|
AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME("authentication.header.authority",
|
||||||
"hawkbit.server.controller.security.authentication.header.authority", Boolean.class,
|
"hawkbit.server.controller.security.authentication.header.authority", String.class,
|
||||||
Boolean.FALSE.toString(), TenantConfigurationBooleanValidator.class),
|
Boolean.FALSE.toString(), TenantConfigurationStringValidator.class),
|
||||||
/**
|
/**
|
||||||
* boolean value {@code true} {@code false}.
|
* boolean value {@code true} {@code false}.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -146,7 +146,6 @@ public class TenantConfigurationManagement implements EnvironmentAware {
|
|||||||
* if the property cannot be converted to the given
|
* if the property cannot be converted to the given
|
||||||
* {@code propertyType}
|
* {@code propertyType}
|
||||||
*/
|
*/
|
||||||
@Cacheable(value = "tenantConfiguration", key = "#configurationKey.getKeyName()")
|
|
||||||
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
|
@PreAuthorize(value = SpringEvalExpressions.HAS_AUTH_TENANT_CONFIGURATION)
|
||||||
public <T> T getGlobalConfigurationValue(final TenantConfigurationKey configurationKey, final Class<T> propertyType)
|
public <T> T getGlobalConfigurationValue(final TenantConfigurationKey configurationKey, final Class<T> propertyType)
|
||||||
throws TenantConfigurationValidatorException {
|
throws TenantConfigurationValidatorException {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
|
|||||||
import org.eclipse.hawkbit.tenancy.configuration.validator.TenantConfigurationValidatorException;
|
import org.eclipse.hawkbit.tenancy.configuration.validator.TenantConfigurationValidatorException;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.springframework.core.convert.ConversionFailedException;
|
|
||||||
|
|
||||||
import ru.yandex.qatools.allure.annotations.Description;
|
import ru.yandex.qatools.allure.annotations.Description;
|
||||||
import ru.yandex.qatools.allure.annotations.Features;
|
import ru.yandex.qatools.allure.annotations.Features;
|
||||||
@@ -86,7 +85,7 @@ public class TenantConfigurationManagementTest extends AbstractIntegrationTestWi
|
|||||||
.isEqualTo(value2);
|
.isEqualTo(value2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(expected = ConversionFailedException.class)
|
@Test(expected = TenantConfigurationValidatorException.class)
|
||||||
@Description("Tests that the get configuration throws exception in case the value cannot be automatically converted from String to Boolean")
|
@Description("Tests that the get configuration throws exception in case the value cannot be automatically converted from String to Boolean")
|
||||||
public void wrongTenantConfigurationValueTypeThrowsException() {
|
public void wrongTenantConfigurationValueTypeThrowsException() {
|
||||||
final TenantConfigurationKey configKey = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED;
|
final TenantConfigurationKey configKey = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED;
|
||||||
|
|||||||
Reference in New Issue
Block a user