use of com.microsoft.azure.sdk.iot.device.ResponseMessage in project azure-iot-sdk-java by Azure.
the class ResponseMessageTest method getStatusReturnStatus.
/* Tests_SRS_RESPONSEMESSAGE_21_005: [The getStatus shall return the stored status.] */
@Test
public void getStatusReturnStatus() {
// arrange
final byte[] body = { 'A', 'B', 'C', '\0' };
final IotHubStatusCode status = IotHubStatusCode.OK;
// act
ResponseMessage msg = new ResponseMessage(body, status);
// assert
assertEquals(status, Deencapsulation.invoke(msg, "getStatus"));
}
use of com.microsoft.azure.sdk.iot.device.ResponseMessage in project azure-iot-sdk-java by Azure.
the class ResponseMessageTest method constructorNullStatusThrows.
/* Tests_SRS_RESPONSEMESSAGE_21_004: [If the message status is null, the constructor shall throw an IllegalArgumentException.] */
@Test(expected = IllegalArgumentException.class)
public void constructorNullStatusThrows() {
// arrange
final byte[] body = { 'A', 'B', 'C', '\0' };
final IotHubStatusCode status = null;
// act
ResponseMessage msg = new ResponseMessage(body, status);
}
Aggregations