Search in sources :

Example 16 with FileUploadNotificationReceiver

use of com.microsoft.azure.sdk.iot.service.FileUploadNotificationReceiver in project azure-iot-sdk-java by Azure.

the class FileUploadNotificationReceiverTest method constructorInputSasTokenEmpty.

// Assert
@Test(expected = IllegalArgumentException.class)
public void constructorInputSasTokenEmpty() throws Exception {
    // Arrange
    final String hostName = "xxx";
    final String userName = "xxx";
    final String sasToken = "";
    IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
    // Act
    FileUploadNotificationReceiver fileUploadNotificationReceiver = Deencapsulation.newInstance(FileUploadNotificationReceiver.class, hostName, userName, sasToken, iotHubServiceClientProtocol);
}
Also used : FileUploadNotificationReceiver(com.microsoft.azure.sdk.iot.service.FileUploadNotificationReceiver) IotHubServiceClientProtocol(com.microsoft.azure.sdk.iot.service.IotHubServiceClientProtocol) Test(org.junit.Test)

Example 17 with FileUploadNotificationReceiver

use of com.microsoft.azure.sdk.iot.service.FileUploadNotificationReceiver in project azure-iot-sdk-java by Azure.

the class FileUploadNotificationReceiverTest method openCallReceiverOpen.

// Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATIONRECEIVER_25_004: [** The function shall call open() on the member AmqpFileUploadNotificationReceive object **]**
@Test
public void openCallReceiverOpen() throws Exception {
    // Arrange
    final String hostName = "xxx";
    final String userName = "xxx";
    final String sasToken = "xxx";
    IotHubServiceClientProtocol iotHubServiceClientProtocol = IotHubServiceClientProtocol.AMQPS;
    FileUploadNotificationReceiver fileUploadNotificationReceiver = Deencapsulation.newInstance(FileUploadNotificationReceiver.class, hostName, userName, sasToken, iotHubServiceClientProtocol);
    // Act
    fileUploadNotificationReceiver.open();
    // Assert
    new Verifications() {

        {
            amqpFileUploadNotificationReceive.open();
            times = 1;
        }
    };
}
Also used : FileUploadNotificationReceiver(com.microsoft.azure.sdk.iot.service.FileUploadNotificationReceiver) Verifications(mockit.Verifications) IotHubServiceClientProtocol(com.microsoft.azure.sdk.iot.service.IotHubServiceClientProtocol) Test(org.junit.Test)

Aggregations

FileUploadNotificationReceiver (com.microsoft.azure.sdk.iot.service.FileUploadNotificationReceiver)17 IotHubServiceClientProtocol (com.microsoft.azure.sdk.iot.service.IotHubServiceClientProtocol)17 Test (org.junit.Test)17 Verifications (mockit.Verifications)9 FileUploadNotification (com.microsoft.azure.sdk.iot.service.FileUploadNotification)2 AmqpFileUploadNotificationReceive (com.microsoft.azure.sdk.iot.service.transport.amqps.AmqpFileUploadNotificationReceive)1