Fix new Sonar Issues
This commit is contained in:
@@ -23,8 +23,6 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.amqp.rabbit.junit.RabbitAvailable;
|
||||
|
||||
/**
|
||||
* Adds infrastructure beans to a Spring test context; do not use with Spring Boot since
|
||||
* it has its own auto configuration mechanism.
|
||||
@@ -47,25 +45,29 @@ public @interface SpringRabbitTest {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the host when not using {@link RabbitAvailable}.
|
||||
* Set the host when not using
|
||||
* {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}.
|
||||
* @return the host.
|
||||
*/
|
||||
String host() default "localhost";
|
||||
|
||||
/**
|
||||
* Set the port when not using {@link RabbitAvailable}.
|
||||
* Set the port when not using
|
||||
* {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}.
|
||||
* @return the port.
|
||||
*/
|
||||
int port() default 5672;
|
||||
|
||||
/**
|
||||
* Set the user when not using {@link RabbitAvailable}.
|
||||
* Set the user when not using
|
||||
* {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}.
|
||||
* @return the user.
|
||||
*/
|
||||
String user() default "guest";
|
||||
|
||||
/**
|
||||
* Set the password when not using {@link RabbitAvailable}.
|
||||
* Set the password when not using
|
||||
* {@link org.springframework.amqp.rabbit.junit.RabbitAvailable}.
|
||||
* @return the password.
|
||||
*/
|
||||
String password() default "guest";
|
||||
|
||||
@@ -103,7 +103,7 @@ public class PooledChannelConnectionFactory extends AbstractConnectionFactory {
|
||||
public synchronized Connection createConnection() throws AmqpException {
|
||||
if (this.connection == null || !this.connection.isOpen()) {
|
||||
Connection bareConnection = createBareConnection(); // NOSONAR - see destroy()
|
||||
this.connection = new ConnectionWrapper(bareConnection.getDelegate(), getCloseTimeout(),
|
||||
this.connection = new ConnectionWrapper(bareConnection.getDelegate(), getCloseTimeout(), // NOSONAR
|
||||
this.simplePublisherConfirms, this.poolConfigurer);
|
||||
}
|
||||
return this.connection;
|
||||
@@ -118,7 +118,7 @@ public class PooledChannelConnectionFactory extends AbstractConnectionFactory {
|
||||
}
|
||||
}
|
||||
|
||||
private final static class ConnectionWrapper extends SimpleConnection {
|
||||
private static final class ConnectionWrapper extends SimpleConnection {
|
||||
|
||||
private final ObjectPool<Channel> channels;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user