fix tests by setting the SystemSecurityContext to prevent NPE in tests
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
This commit is contained in:
committed by
Nonnenmacher Fabian
parent
2be4922615
commit
4ca1bdf9ef
@@ -38,8 +38,18 @@ public class SystemSecurityContext {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SystemSecurityContext.class);
|
||||
|
||||
private final TenantAware tenantAware;
|
||||
|
||||
/**
|
||||
* Autowired constructor.
|
||||
*
|
||||
* @param tenantAware
|
||||
* the tenant aware bean to retrieve the current tenant
|
||||
*/
|
||||
@Autowired
|
||||
private TenantAware tenantAware;
|
||||
public SystemSecurityContext(final TenantAware tenantAware) {
|
||||
this.tenantAware = tenantAware;
|
||||
}
|
||||
|
||||
public <T> T runAsSystem(final Callable<T> callable) {
|
||||
final SecurityContext oldContext = SecurityContextHolder.getContext();
|
||||
|
||||
Reference in New Issue
Block a user