use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFeedbackReceivedHandler in project azure-iot-sdk-java by Azure.
the class AmqpReceiveHandlerTest method onConnectionBound_call_flow_and_init_ok_amqp.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_009: [The event handler shall set the SASL PLAIN authentication on the Transport using the given user name and sas token]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_010: [The event handler shall set ANONYMUS_PEER authentication mode on the domain of the Transport]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_017: [The event handler shall not initialize WebSocket if the protocol is AMQP]
@Test
public void onConnectionBound_call_flow_and_init_ok_amqp() {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
AmqpFeedbackReceivedHandler amqpReceiveHandler = new AmqpFeedbackReceivedHandler(hostName, userName, sasToken, iotHubServiceClientProtocol, null);
// Assert
new Expectations() {
{
connection = event.getConnection();
transport = connection.getTransport();
sasl.plain(anyString, anyString);
sslDomain = Proton.sslDomain();
sslDomain.init(SslDomain.Mode.CLIENT);
sslDomain.setPeerAuthentication(SslDomain.VerifyMode.ANONYMOUS_PEER);
transport.ssl(sslDomain);
}
};
// Act
amqpReceiveHandler.onConnectionBound(event);
}
Aggregations