use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method constructorThrowsOnEmptyBlobUri.
// 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 constructorThrowsOnEmptyBlobUri() throws IOException {
//arrange
final String actualDeviceId = "TestDeviceId";
final String actualBlobUri = "";
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 constructorSavesParameters.
// Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_001: [** The constructor shall save all the parameters only if they are valid **]
@Test
public void constructorSavesParameters() throws IOException {
//arrange
final String actualDeviceId = "TestDeviceId";
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 constructorThrowsOnNullDate.
// 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 constructorThrowsOnNullDate() throws IOException {
//arrange
final String actualDeviceId = "TestDeviceId";
final String actualBlobUri = "TestblobUri";
final String actualBlobName = "TestBlobName";
final Date actualLastUpdatedTimeDate = null;
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 getLastUpdatedTimeDateGets.
//Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_007: [ The getter for lastUpdatedTimeDate ]
@Test
public void getLastUpdatedTimeDateGets() throws IOException {
//arrange
final Date actualLastUpdatedTimeDate = new Date();
FileUploadNotification testFileUploadNotification = new FileUploadNotification(mockDeviceId, mockBlobUri, mockBlobName, actualLastUpdatedTimeDate, mockBlobSizeInBytes, mockEnqueuedTimeUtcDate);
//act
Date testLastUpdatedTimeDate = testFileUploadNotification.getLastUpdatedTimeDate();
//assert
assertEquals(testLastUpdatedTimeDate, actualLastUpdatedTimeDate);
}
use of com.microsoft.azure.sdk.iot.service.FileUploadNotification in project azure-iot-sdk-java by Azure.
the class FileUploadNotificationTest method getBlobSizeInBytesGets.
//Tests_SRS_SERVICE_SDK_JAVA_FILEUPLOADNOTIFICATION_25_009: [ The getter for blobSizeInBytes ]
@Test
public void getBlobSizeInBytesGets() throws IOException {
//arrange
final Long actualBlobSizeInBytes = 10000L;
FileUploadNotification testFileUploadNotification = new FileUploadNotification(mockDeviceId, mockBlobUri, mockBlobName, mockLastUpdatedTimeDate, actualBlobSizeInBytes, mockEnqueuedTimeUtcDate);
//act
Long testBlobSizeInBytes = testFileUploadNotification.getBlobSizeInBytes();
//assert
assertEquals(testBlobSizeInBytes, actualBlobSizeInBytes);
}
Aggregations