use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFileUploadNotificationReceive in project azure-iot-sdk-java by Azure.
the class AmqpFileUploadNotificationReceiveTest method amqpFileUploadNotificationReceiveInitOk.
// Tests_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVE_25_001: [The constructor shall copy all input parameters to private member variables for event processing]
@Test
public void amqpFileUploadNotificationReceiveInitOk() {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
// Act
AmqpFileUploadNotificationReceive amqpFileUploadNotificationReceive = new AmqpFileUploadNotificationReceive(hostName, userName, sasToken, iotHubServiceClientProtocol);
final String _hostName = Deencapsulation.getField(amqpFileUploadNotificationReceive, "hostName");
final String _userName = Deencapsulation.getField(amqpFileUploadNotificationReceive, "userName");
final String _sasToken = Deencapsulation.getField(amqpFileUploadNotificationReceive, "sasToken");
// Assert
assertEquals(hostName, _hostName);
assertEquals(userName, _userName);
assertEquals(sasToken, _sasToken);
}
use of com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFileUploadNotificationReceive in project azure-iot-sdk-java by Azure.
the class AmqpFileUploadNotificationReceiveTest method receiveCreatesNewHandlerEachCall.
@Test
public void receiveCreatesNewHandlerEachCall(@Mocked AmqpFileUploadNotificationReceivedHandler mockHandler) throws IOException, InterruptedException {
// Arrange
final String hostName = "aaa";
final String userName = "bbb";
final String sasToken = "ccc";
IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
int timeoutMs = 1;
AmqpFileUploadNotificationReceive amqpFileUploadNotificationReceive = new AmqpFileUploadNotificationReceive(hostName, userName, sasToken, iotHubServiceClientProtocol);
// Act
amqpFileUploadNotificationReceive.open();
amqpFileUploadNotificationReceive.receive(timeoutMs);
AmqpFileUploadNotificationReceivedHandler handler = Deencapsulation.getField(amqpFileUploadNotificationReceive, "amqpReceiveHandler");
amqpFileUploadNotificationReceive.receive(timeoutMs);
AmqpFileUploadNotificationReceivedHandler handler2 = Deencapsulation.getField(amqpFileUploadNotificationReceive, "amqpReceiveHandler");
// Assert
assertNotEquals(handler, handler2);
}
Aggregations