use of com.microsoft.azure.sdk.iot.device.fileupload.FileUploadTask in project azure-iot-sdk-java by Azure.
the class FileUploadTaskTest method runCloseConnectionToIothubForRequestAndNotification.
/* Tests_SRS_FILEUPLOADTASK_21_012: [The run shall close the connection with the iothub, using the httpsTransportManager.] */
/* Tests_SRS_FILEUPLOADTASK_21_028: [The run shall close the connection with the iothub, using the httpsTransportManager.] */
@Test
public void runCloseConnectionToIothubForRequestAndNotification() throws IOException, IllegalArgumentException, URISyntaxException {
// arrange
expectSuccess(VALID_BLOB_NAME, VALID_CORRELATION_ID, VALID_HOST_NAME, VALID_CONTAINER_NAME, VALID_SAS_TOKEN, VALID_REQUEST_JSON, VALID_RESPONSE_JSON, VALID_NOTIFICATION_JSON);
FileUploadTask fileUploadTask = Deencapsulation.newInstance(FileUploadTask.class, new Class[] { String.class, InputStream.class, long.class, HttpsTransportManager.class, IotHubEventCallback.class, Object.class }, VALID_BLOB_NAME, mockInputStream, VALID_STREAM_LENGTH, mockHttpsTransportManager, mockIotHubEventCallback, VALID_CALLBACK_CONTEXT);
// act
Deencapsulation.invoke(fileUploadTask, "run");
// assert
new Verifications() {
{
Deencapsulation.invoke(mockHttpsTransportManager, "close");
times = 2;
}
};
}
Aggregations