Fix default isolation and auto commit (#484)
* Switch to spring/DB default isolation. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix dependency to uncommited isolation level in rollout management. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Corrected UQ checks Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Remove modifying annotation. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Disable autocommit on connection pool. Cleanups. Flush at commit. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Cleanups. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix Rollout UI performance. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Typo fixed Signed-off-by: Dominic Schabel <dominic.schabel@bosch-si.com> * Remove empty lines Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -23,6 +23,8 @@ import org.junit.Assert;
|
||||
import org.junit.rules.TestRule;
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runners.model.Statement;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.cloud.bus.event.RemoteApplicationEvent;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
@@ -38,6 +40,7 @@ import com.jayway.awaitility.core.ConditionTimeoutException;
|
||||
* Test rule to setup and verify the event count for a method.
|
||||
*/
|
||||
public class EventVerifier implements TestRule {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EventVerifier.class);
|
||||
|
||||
private EventCaptor eventCaptor;
|
||||
|
||||
@@ -116,6 +119,7 @@ public class EventVerifier implements TestRule {
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(final RemoteApplicationEvent event) {
|
||||
LOGGER.debug("Received event {}", event.getClass().getSimpleName());
|
||||
capturedEvents.add(event.getClass());
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ public abstract class AbstractIntegrationTest implements EnvironmentAware {
|
||||
@Before
|
||||
public void before() throws Exception {
|
||||
mvc = createMvcWebAppContext().build();
|
||||
final String description = "Updated description to have lastmodified available in tests";
|
||||
final String description = "Updated description.";
|
||||
|
||||
osType = securityRule
|
||||
.runAsPrivileged(() -> testdataFactory.findOrCreateSoftwareModuleType(TestdataFactory.SM_TYPE_OS));
|
||||
|
||||
@@ -15,7 +15,6 @@ import org.eclipse.hawkbit.repository.SystemManagement;
|
||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
public class JpaTestRepositoryManagement implements TestRepositoryManagement {
|
||||
|
||||
@@ -45,13 +44,11 @@ public class JpaTestRepositoryManagement implements TestRepositoryManagement {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void clearTestRepository() {
|
||||
deleteAllRepos();
|
||||
cacheManager.getDirectCacheNames().forEach(name -> cacheManager.getDirectCache(name).clear());
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteAllRepos() {
|
||||
final List<String> tenants = systemSecurityContext.runAsSystem(() -> systemManagement.findTenants());
|
||||
tenants.forEach(tenant -> {
|
||||
|
||||
Reference in New Issue
Block a user