Code refactoring of hawkbit-repository (#2056)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-17 15:03:03 +02:00
committed by GitHub
parent 7cb617007a
commit f9bb48d697
118 changed files with 622 additions and 797 deletions

View File

@@ -17,12 +17,11 @@ import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicLong;
import org.eclipse.hawkbit.ContextAware;
import org.eclipse.hawkbit.tenancy.configuration.ControllerPollProperties;
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties;
import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler;
import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemProperties;
import org.eclipse.hawkbit.artifact.repository.ArtifactFilesystemRepository;
import org.eclipse.hawkbit.artifact.repository.ArtifactRepository;
import org.eclipse.hawkbit.artifact.repository.urlhandler.ArtifactUrlHandlerProperties;
import org.eclipse.hawkbit.artifact.repository.urlhandler.PropertyBasedArtifactUrlHandler;
import org.eclipse.hawkbit.cache.TenantAwareCacheManager;
import org.eclipse.hawkbit.event.BusProtoStuffMessageConverter;
import org.eclipse.hawkbit.im.authentication.SpRole;
@@ -43,6 +42,7 @@ import org.eclipse.hawkbit.security.SpringSecurityAuditorAware;
import org.eclipse.hawkbit.security.SystemSecurityContext;
import org.eclipse.hawkbit.tenancy.TenantAware;
import org.eclipse.hawkbit.tenancy.UserAuthoritiesResolver;
import org.eclipse.hawkbit.tenancy.configuration.ControllerPollProperties;
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationProperties;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;

View File

@@ -112,9 +112,7 @@ import org.springframework.test.context.TestPropertySource;
public abstract class AbstractIntegrationTest {
protected static final Pageable PAGE = PageRequest.of(0, 500, Sort.by(Direction.ASC, "id"));
protected static final URI LOCALHOST = URI.create("http://127.0.0.1");
protected static final int DEFAULT_TEST_WEIGHT = 500;
/**
@@ -125,80 +123,58 @@ public abstract class AbstractIntegrationTest {
*/
protected static final int DEFAULT_DS_TYPES = RepositoryConstants.DEFAULT_DS_TYPES_IN_TENANT + 1;
private static final String ARTIFACT_DIRECTORY = createTempDir();
@Autowired
protected EntityFactory entityFactory;
@Autowired
protected SoftwareModuleManagement softwareModuleManagement;
@Autowired
protected SoftwareModuleTypeManagement softwareModuleTypeManagement;
@Autowired
protected DistributionSetManagement distributionSetManagement;
@Autowired
protected DistributionSetTypeManagement distributionSetTypeManagement;
@Autowired
protected ControllerManagement controllerManagement;
@Autowired
protected TargetManagement targetManagement;
@Autowired
protected TargetTypeManagement targetTypeManagement;
@Autowired
protected TargetFilterQueryManagement targetFilterQueryManagement;
@Autowired
protected TargetTagManagement targetTagManagement;
@Autowired
protected DistributionSetTagManagement distributionSetTagManagement;
@Autowired
protected DeploymentManagement deploymentManagement;
@Autowired
protected ConfirmationManagement confirmationManagement;
@Autowired
protected DistributionSetInvalidationManagement distributionSetInvalidationManagement;
@Autowired
protected ArtifactManagement artifactManagement;
@Autowired
protected AuditingHandler auditingHandler;
@Autowired
protected TenantAware tenantAware;
@Autowired
protected SystemManagement systemManagement;
@Autowired
protected TenantConfigurationManagement tenantConfigurationManagement;
@Autowired
protected RolloutManagement rolloutManagement;
@Autowired
protected RolloutHandler rolloutHandler;
@Autowired
protected RolloutGroupManagement rolloutGroupManagement;
@Autowired
protected SystemSecurityContext systemSecurityContext;
@Autowired
protected ArtifactRepository binaryArtifactRepository;
@Autowired
protected TenantAwareCacheManager cacheManager;
@Autowired
protected QuotaManagement quotaManagement;
@@ -210,13 +186,10 @@ public abstract class AbstractIntegrationTest {
@Autowired
protected TestdataFactory testdataFactory;
@Autowired
protected ServiceMatcher serviceMatcher;
@Autowired
protected ApplicationEventPublisher eventPublisher;
private static final String ARTIFACT_DIRECTORY = createTempDir();
@BeforeAll
public static void beforeClass() {

View File

@@ -51,4 +51,4 @@ public abstract class AbstractSqlTestDatabase extends AbstractTestExecutionListe
log.error("Execution of statement '{}' on uri {} failed!", statement, uri, e);
}
}
}
}

View File

@@ -33,4 +33,4 @@ public class CleanupTestExecutionListener extends AbstractTestExecutionListener
return null;
});
}
}
}

View File

@@ -18,9 +18,9 @@ import java.util.Objects;
import java.util.concurrent.Callable;
import org.eclipse.hawkbit.im.authentication.SpPermission;
import org.eclipse.hawkbit.repository.model.helper.SystemManagementHolder;
import org.eclipse.hawkbit.tenancy.TenantAwareAuthenticationDetails;
import org.eclipse.hawkbit.tenancy.TenantAwareUser;
import org.eclipse.hawkbit.repository.model.helper.SystemManagementHolder;
import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContext;