21
21
import static org .assertj .core .api .Assertions .assertThat ;
22
22
23
23
import com .rabbitmq .client .amqp .AmqpException ;
24
+ import javax .net .ssl .SSLException ;
24
25
import org .apache .qpid .protonj2 .client .ErrorCondition ;
26
+ import org .apache .qpid .protonj2 .client .exceptions .ClientConnectionRemotelyClosedException ;
27
+ import org .apache .qpid .protonj2 .client .exceptions .ClientException ;
25
28
import org .apache .qpid .protonj2 .client .exceptions .ClientLinkRemotelyClosedException ;
26
29
import org .apache .qpid .protonj2 .client .exceptions .ClientSessionRemotelyClosedException ;
27
30
import org .junit .jupiter .api .Test ;
@@ -48,6 +51,19 @@ void convertTest() {
48
51
.isInstanceOf (AmqpException .AmqpEntityDoesNotExistException .class );
49
52
assertThat (convert (new ClientLinkRemotelyClosedException ("" )))
50
53
.isInstanceOf (AmqpException .AmqpResourceClosedException .class );
54
+ assertThat (convert (new ClientConnectionRemotelyClosedException ("connection reset" )))
55
+ .isInstanceOf (AmqpException .AmqpConnectionException .class );
56
+ assertThat (convert (new ClientConnectionRemotelyClosedException ("connection refused" )))
57
+ .isInstanceOf (AmqpException .AmqpConnectionException .class );
58
+ assertThat (convert (new ClientConnectionRemotelyClosedException ("" , new RuntimeException ())))
59
+ .isInstanceOf (AmqpException .AmqpConnectionException .class )
60
+ .hasCauseInstanceOf (ClientConnectionRemotelyClosedException .class );
61
+ assertThat (convert (new ClientConnectionRemotelyClosedException ("" , new SSLException ("" ))))
62
+ .isInstanceOf (AmqpException .AmqpSecurityException .class )
63
+ .hasCauseInstanceOf (SSLException .class );
64
+ assertThat (convert (new ClientException ("" )))
65
+ .isInstanceOf (AmqpException .class )
66
+ .hasCauseInstanceOf (ClientException .class );
51
67
}
52
68
53
69
ErrorCondition errorCondition (String condition ) {
0 commit comments