use of com.microsoft.azure.sdk.iot.deps.twin.RegisterManager in project azure-iot-sdk-java by Azure.
the class RegisterManagerTest method setETagSucceed.
/* Tests_SRS_REGISTER_MANAGER_21_003: [The setETag shall replace the `eTag` by the provided one.] */
@Test
public void setETagSucceed() {
// arrange
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().disableHtmlEscaping().create();
RegisterManager result = gson.fromJson(REGISTER_MANAGER_SAMPLE, RegisterManager.class);
// act
result.setETag("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyy");
// assert
assertEquals("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyy", Deencapsulation.getField(result, "eTag"));
}
use of com.microsoft.azure.sdk.iot.deps.twin.RegisterManager in project azure-iot-sdk-java by Azure.
the class RegisterManagerTest method setDeviceIdThrowsOnNullDeviceId.
/* Tests_SRS_REGISTER_MANAGER_21_001: [The setDeviceId shall throw IllegalArgumentException if the provided deviceId do not fits the criteria.] */
@Test(expected = IllegalArgumentException.class)
public void setDeviceIdThrowsOnNullDeviceId() {
// arrange
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().disableHtmlEscaping().create();
RegisterManager result = gson.fromJson(REGISTER_MANAGER_SAMPLE, RegisterManager.class);
// act - assert
result.setDeviceId(null);
}
Aggregations