Code refactoring of hawkbit-mgmt (#2055)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -58,4 +58,4 @@ public enum EventTopic {
|
||||
* Topic when confirmation of an action is requested.
|
||||
*/
|
||||
CONFIRM
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,4 +20,4 @@ public interface TestRabbitListener {
|
||||
* @param message the message
|
||||
*/
|
||||
void handleMessage(Message message);
|
||||
}
|
||||
}
|
||||
@@ -27,4 +27,4 @@ public class DMFStart {
|
||||
public static void main(final String[] args) {
|
||||
SpringApplication.run(DMFStart.class, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,4 +36,4 @@ public class DmfApiAutoConfiguration {
|
||||
public ErrorHandler errorHandler() {
|
||||
return new ConditionalRejectingErrorHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user