use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method getBlobNameGets.
//Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_005: [ The getter for blobName ]
@Test
public void getBlobNameGets() throws IOException {
//arrange
final String actualBlobName = "TestBlobName";
FileUploadNotification testFileUploadNotification = new FileUploadNotification(mockDeviceId, mockBlobUri, actualBlobName, mockLastUpdatedTimeDate, mockBlobSizeInBytes, mockEnqueuedTimeUtcDate);
//act
final String testBlobName = testFileUploadNotification.getBlobName();
//assert
assertEquals(testBlobName, actualBlobName);
}
use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method constructorThrowsOnNullDevID.
// Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_002: [** If any of the parameters are null or empty then this method shall throw IllegalArgumentException.**]
@Test(expected = IllegalArgumentException.class)
public void constructorThrowsOnNullDevID() throws IOException {
//arrange
final String actualDeviceId = null;
final String actualBlobUri = "TestblobUri";
final String actualBlobName = "TestBlobName";
final Date actualLastUpdatedTimeDate = new Date();
final Long actualBlobSizeInBytes = 10000L;
final Date actualEnqueuedTimeUtcDate = new Date();
//act
FileUploadNotification testFileUploadNotification = new FileUploadNotification(actualDeviceId, actualBlobUri, actualBlobName, actualLastUpdatedTimeDate, actualBlobSizeInBytes, actualEnqueuedTimeUtcDate);
//assert
assertEquals(testFileUploadNotification.getDeviceId(), actualDeviceId);
assertEquals(testFileUploadNotification.getBlobName(), actualBlobName);
assertEquals(testFileUploadNotification.getBlobUri(), actualBlobUri);
assertEquals(testFileUploadNotification.getLastUpdatedTimeDate(), actualLastUpdatedTimeDate);
assertEquals(testFileUploadNotification.getBlobSizeInBytes(), actualBlobSizeInBytes);
assertEquals(testFileUploadNotification.getEnqueuedTimeUtcDate(), actualEnqueuedTimeUtcDate);
}
use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method getEnqueuedTimeUtcDateGets.
//Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_011: [ The getter for enqueuedTimeUtcDate ]
@Test
public void getEnqueuedTimeUtcDateGets() throws IOException {
//arrange
final Date actualEnqueuedTimeUtcDate = new Date();
FileUploadNotification testFileUploadNotification = new FileUploadNotification(mockDeviceId, mockBlobUri, mockBlobName, mockLastUpdatedTimeDate, mockBlobSizeInBytes, actualEnqueuedTimeUtcDate);
//act
Date testEnqueuedTimeUtcDate = testFileUploadNotification.getEnqueuedTimeUtcDate();
//assert
assertEquals(testEnqueuedTimeUtcDate, actualEnqueuedTimeUtcDate);
}
use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method constructorThrowsOnNullBlobName.
// Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_002: [** If any of the parameters are null or empty then this method shall throw IllegalArgumentException.**]
@Test(expected = IllegalArgumentException.class)
public void constructorThrowsOnNullBlobName() throws IOException {
//arrange
final String actualDeviceId = "TestDeviceId";
final String actualBlobUri = "TestblobUri";
final String actualBlobName = null;
final Date actualLastUpdatedTimeDate = new Date();
final Long actualBlobSizeInBytes = 10000L;
final Date actualEnqueuedTimeUtcDate = new Date();
//act
FileUploadNotification testFileUploadNotification = new FileUploadNotification(actualDeviceId, actualBlobUri, actualBlobName, actualLastUpdatedTimeDate, actualBlobSizeInBytes, actualEnqueuedTimeUtcDate);
//assert
assertEquals(testFileUploadNotification.getDeviceId(), actualDeviceId);
assertEquals(testFileUploadNotification.getBlobName(), actualBlobName);
assertEquals(testFileUploadNotification.getBlobUri(), actualBlobUri);
assertEquals(testFileUploadNotification.getLastUpdatedTimeDate(), actualLastUpdatedTimeDate);
assertEquals(testFileUploadNotification.getBlobSizeInBytes(), actualBlobSizeInBytes);
assertEquals(testFileUploadNotification.getEnqueuedTimeUtcDate(), actualEnqueuedTimeUtcDate);
}
use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method constructorThrowsOnEmptyDevID.
// Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_002: [** If any of the parameters are null or empty then this method shall throw IllegalArgumentException.**]
@Test(expected = IllegalArgumentException.class)
public void constructorThrowsOnEmptyDevID() throws IOException {
//arrange
final String actualDeviceId = "";
final String actualBlobUri = "TestblobUri";
final String actualBlobName = "TestBlobName";
final Date actualLastUpdatedTimeDate = new Date();
final Long actualBlobSizeInBytes = 10000L;
final Date actualEnqueuedTimeUtcDate = new Date();
//act
FileUploadNotification testFileUploadNotification = new FileUploadNotification(actualDeviceId, actualBlobUri, actualBlobName, actualLastUpdatedTimeDate, actualBlobSizeInBytes, actualEnqueuedTimeUtcDate);
//assert
assertEquals(testFileUploadNotification.getDeviceId(), actualDeviceId);
assertEquals(testFileUploadNotification.getBlobName(), actualBlobName);
assertEquals(testFileUploadNotification.getBlobUri(), actualBlobUri);
assertEquals(testFileUploadNotification.getLastUpdatedTimeDate(), actualLastUpdatedTimeDate);
assertEquals(testFileUploadNotification.getBlobSizeInBytes(), actualBlobSizeInBytes);
assertEquals(testFileUploadNotification.getEnqueuedTimeUtcDate(), actualEnqueuedTimeUtcDate);
}
Aggregations