diff --git a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/SecurityContextSwitch.java b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/SecurityContextSwitch.java index fd6a6bc06..945c4ab2e 100644 --- a/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/SecurityContextSwitch.java +++ b/hawkbit-repository/hawkbit-repository-test/src/main/java/org/eclipse/hawkbit/repository/test/util/SecurityContextSwitch.java @@ -137,9 +137,10 @@ public class SecurityContextSwitch { @Serial private static final long serialVersionUID = 1L; - private transient final WithUser annotation; + // could be serializable and could be serialized, must not be made transient + private final WithUser annotation; - public WithUserSecurityContext(final WithUser annotation) { + WithUserSecurityContext(final WithUser annotation) { this.annotation = annotation; if (annotation.autoCreateTenant()) { createTenant(annotation.tenantId());