Bump spring-cloud-starter-openfeign to 4.3.1 (#2898)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2026-01-30 16:38:01 +02:00
committed by GitHub
parent a86be566fc
commit 8cac79f860
6 changed files with 31 additions and 39 deletions

View File

@@ -9,8 +9,7 @@
*/
package org.eclipse.hawkbit.repository.test.util;
import java.security.SecureRandom;
import java.util.Random;
import static org.eclipse.hawkbit.repository.test.util.TestdataFactory.SECURE_RND;
import lombok.NoArgsConstructor;
import org.eclipse.hawkbit.repository.model.Target;
@@ -24,20 +23,19 @@ public class TargetTestData {
public static final String ATTRIBUTE_VALUE_VALID;
static {
final Random rand = new SecureRandom();
ATTRIBUTE_KEY_TOO_LONG = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_KEY_SIZE + 1, rand);
ATTRIBUTE_KEY_VALID = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_KEY_SIZE, rand);
ATTRIBUTE_VALUE_TOO_LONG = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_VALUE_SIZE + 1, rand);
ATTRIBUTE_VALUE_VALID = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_VALUE_SIZE, rand);
ATTRIBUTE_KEY_TOO_LONG = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_KEY_SIZE + 1);
ATTRIBUTE_KEY_VALID = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_KEY_SIZE);
ATTRIBUTE_VALUE_TOO_LONG = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_VALUE_SIZE + 1);
ATTRIBUTE_VALUE_VALID = generateRandomStringWithLength(Target.CONTROLLER_ATTRIBUTE_MAX_VALUE_SIZE);
}
private static String generateRandomStringWithLength(final int length, final Random rand) {
private static String generateRandomStringWithLength(final int length) {
final StringBuilder randomStringBuilder = new StringBuilder(length);
final int lowercaseACode = 97;
final int lowercaseZCode = 122;
for (int i = 0; i < length; i++) {
final char randomCharacter = (char) (rand.nextInt(lowercaseZCode - lowercaseACode + 1) + lowercaseACode);
final char randomCharacter = (char) (SECURE_RND.nextInt(lowercaseZCode - lowercaseACode + 1) + lowercaseACode);
randomStringBuilder.append(randomCharacter);
}
return randomStringBuilder.toString();

View File

@@ -93,6 +93,7 @@ public class TestdataFactory {
@SuppressWarnings("java:S2245") // used for tests only, no need of secure random
public static final Random RND = new Random();
public static final SecureRandom SECURE_RND = new SecureRandom();
public static final String VISIBLE_SM_MD_KEY = "visibleMetdataKey";
public static final String VISIBLE_SM_MD_VALUE = "visibleMetdataValue";
@@ -309,7 +310,7 @@ public class TestdataFactory {
SoftwareModuleManagement.Create.builder()
.type(findOrCreateSoftwareModuleType(SM_TYPE_APP, Integer.MAX_VALUE))
.name(prefix + SM_TYPE_APP)
.version(version + "." + new SecureRandom().nextInt(100))
.version(version + "." + SECURE_RND.nextInt(100))
.description(randomDescriptionLong())
.vendor(prefix + " vendor Limited, California")
.build());
@@ -317,14 +318,14 @@ public class TestdataFactory {
.create(SoftwareModuleManagement.Create.builder()
.type(findOrCreateSoftwareModuleType(SM_TYPE_RT))
.name(prefix + "app runtime")
.version(version + "." + new SecureRandom().nextInt(100))
.version(version + "." + SECURE_RND.nextInt(100))
.description(randomDescriptionLong()).vendor(prefix + " vendor GmbH, Stuttgart, Germany")
.build());
final SoftwareModule osMod = softwareModuleManagement
.create(SoftwareModuleManagement.Create.builder()
.type(findOrCreateSoftwareModuleType(SM_TYPE_OS))
.name(prefix + " Firmware")
.version(version + "." + new SecureRandom().nextInt(100))
.version(version + "." + SECURE_RND.nextInt(100))
.description(randomDescriptionLong()).vendor(prefix + " vendor Limited Inc, California")
.build());