Code refactoring of hawkbit-mgmt (#2055)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-17 13:35:51 +02:00
committed by GitHub
parent c90e3384ef
commit 7cb617007a
107 changed files with 2579 additions and 2240 deletions

View File

@@ -58,4 +58,4 @@ public enum EventTopic {
* Topic when confirmation of an action is requested.
*/
CONFIRM
}
}

View File

@@ -36,11 +36,9 @@ import org.springframework.test.context.ContextConfiguration;
@Slf4j
@RabbitAvailable
@ContextConfiguration(classes = { RepositoryApplicationConfiguration.class, AmqpTestConfiguration.class,
TestConfiguration.class })
@ContextConfiguration(classes = { RepositoryApplicationConfiguration.class, AmqpTestConfiguration.class, TestConfiguration.class })
@Import(TestChannelBinderConfiguration.class)
// Dirty context is necessary to create a new vhost and recreate all necessary
// beans after every test class.
// Dirty context is necessary to create a new vhost and recreate all necessary beans after every test class.
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public abstract class AbstractAmqpIntegrationTest extends AbstractIntegrationTest {
@@ -48,7 +46,6 @@ public abstract class AbstractAmqpIntegrationTest extends AbstractIntegrationTes
@Autowired
private ConnectionFactory connectionFactory;
@Autowired
private RabbitAdmin rabbitAdmin;
@@ -109,5 +106,4 @@ public abstract class AbstractAmqpIntegrationTest extends AbstractIntegrationTes
template.setExchange(getExchange());
return template;
}
}
}

View File

@@ -9,8 +9,6 @@
*/
package org.eclipse.hawkbit.rabbitmq.test;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

View File

@@ -24,8 +24,7 @@ import org.springframework.amqp.rabbit.junit.BrokerRunningSupport;
import org.springframework.util.ObjectUtils;
/**
* Creates and deletes a new virtual host if the rabbit mq management api is
* available.
* Creates and deletes a new virtual host if the rabbit mq management api is available.
*/
// exception squid:S2068 - Test instance passwd
@SuppressWarnings("squid:S2068")
@@ -39,8 +38,7 @@ public class RabbitMqSetupService {
private String virtualHost;
public RabbitMqSetupService() {
BrokerRunningSupport brokerSupport = BrokerRunningSupport.isRunning();
final BrokerRunningSupport brokerSupport = BrokerRunningSupport.isRunning();
connectionFactory = brokerSupport.getConnectionFactory();
hostname = brokerSupport.getHostName();
username = brokerSupport.getUser();
@@ -99,4 +97,4 @@ public class RabbitMqSetupService {
permissions.setWrite(".*");
return permissions;
}
}
}

View File

@@ -20,4 +20,4 @@ public interface TestRabbitListener {
* @param message the message
*/
void handleMessage(Message message);
}
}

View File

@@ -27,4 +27,4 @@ public class DMFStart {
public static void main(final String[] args) {
SpringApplication.run(DMFStart.class, args);
}
}
}

View File

@@ -36,4 +36,4 @@ public class DmfApiAutoConfiguration {
public ErrorHandler errorHandler() {
return new ConditionalRejectingErrorHandler();
}
}
}