use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFeedbackReceivedEvent in project azure-iot-sdk-java by Azure.
the class AmqpFileUploadNotificationReceivedHandlerTest method amqpReceiveHandlerCallFlowAndInitOk.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_001: [The constructor shall copy all input parameters to private member variables for event processing]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_002: [The constructor shall initialize a new Handshaker (Proton) object to handle communication handshake]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_003: [The constructor shall initialize a new FlowController (Proton) object to handle communication handshake]
@Test
public void amqpReceiveHandlerCallFlowAndInitOk() {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Assert
new Expectations() {
{
handshaker = new Handshaker();
flowcontroller = new FlowController();
}
};
// Act
Object amqpReceiveHandler = Deencapsulation.newInstance(AmqpFileUploadNotificationReceivedHandler.class, hostName, userName, sasToken, iotHubServiceClientProtocol, amqpFeedbackReceivedEvent);
final String _hostName = Deencapsulation.getField(amqpReceiveHandler, "hostName");
final String _userName = Deencapsulation.getField(amqpReceiveHandler, "userName");
final String _sasToken = Deencapsulation.getField(amqpReceiveHandler, "sasToken");
AmqpFeedbackReceivedEvent _amqpFeedbackReceivedEvent = Deencapsulation.getField(amqpReceiveHandler, "amqpFeedbackReceivedEvent");
// Assert
assertEquals(hostName + ":5671", _hostName);
assertEquals(userName, _userName);
assertEquals(sasToken, _sasToken);
assertEquals(amqpFeedbackReceivedEvent, _amqpFeedbackReceivedEvent);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFeedbackReceivedEvent in project azure-iot-sdk-java by Azure.
the class AmqpReceiveHandlerTest method amqpReceiveHandler_call_flow_and_init_ok.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_001: [The constructor shall copy all input parameters to private member variables for event processing]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_002: [The constructor shall initialize a new Handshaker (Proton) object to handle communication handshake]
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_003: [The constructor shall initialize a new FlowController (Proton) object to handle communication handshake]
@Test
public void amqpReceiveHandler_call_flow_and_init_ok() {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Assert
new Expectations() {
{
handshaker = new Handshaker();
flowcontroller = new FlowController();
}
};
// Act
AmqpFeedbackReceivedHandler amqpReceiveHandler = new AmqpFeedbackReceivedHandler(hostName, userName, sasToken, iotHubServiceClientProtocol, amqpFeedbackReceivedEvent);
final String _hostName = Deencapsulation.getField(amqpReceiveHandler, "hostName");
final String _userName = Deencapsulation.getField(amqpReceiveHandler, "userName");
final String _sasToken = Deencapsulation.getField(amqpReceiveHandler, "sasToken");
AmqpFeedbackReceivedEvent _amqpFeedbackReceivedEvent = Deencapsulation.getField(amqpReceiveHandler, "amqpFeedbackReceivedEvent");
// Assert
assertEquals(hostName + ":5671", _hostName);
assertEquals(userName, _userName);
assertEquals(sasToken, _sasToken);
assertEquals(amqpFeedbackReceivedEvent, _amqpFeedbackReceivedEvent);
}
Aggregations