msg.setProperty("temperatureAlert", temperature > 28 ? "true" : "false"); msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setExpiryTime(D2C_MESSAGE_TIMEOUT); System.out.println(msgStr); EventCallback eventCallback = new EventCallback();
msg.setProperty("temperatureAlert", temperature > 28 ? "true" : "false"); msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setExpiryTime(D2C_MESSAGE_TIMEOUT); System.out.println(msgStr);
messagesToSend.get(i).message.setExpiryTime(200);
msg.setProperty("temperatureAlert", temperature > 28 ? "true" : "false"); msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setExpiryTime(D2C_MESSAGE_TIMEOUT); System.out.println(msgStr);
msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setProperty("temperatureAlert", (data.temperature > 28) ? "true" : "false"); msg.setExpiryTime(5000);
msg.setProperty("temperatureAlert", temperature > 28 ? "true" : "false"); msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setExpiryTime(D2C_MESSAGE_TIMEOUT); System.out.println(msgStr); EventCallback eventCallback = new EventCallback();
public void errorInjectionTestFlow(Message errorInjectionMessage) throws Exception { // Arrange List<Pair<IotHubConnectionStatus, Throwable>> actualStatusUpdates = new ArrayList<>(); setConnectionStatusCallBack(actualStatusUpdates); invokeMethodSucceed(); // Act errorInjectionMessage.setExpiryTime(200); MessageAndResult errorInjectionMsgAndRet = new MessageAndResult(errorInjectionMessage, null); this.testInstance.deviceTestManager.sendMessageAndWaitForResponse( errorInjectionMsgAndRet, RETRY_MILLISECONDS, SEND_TIMEOUT_MILLISECONDS, this.testInstance.protocol); // Assert IotHubServicesCommon.waitForStabilizedConnection(actualStatusUpdates, ERROR_INJECTION_WAIT_TIMEOUT, this.testInstance.deviceTestManager.client); invokeMethodSucceed(); } }
msg.setProperty("temperatureAlert", temperature > 28 ? "true" : "false"); msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setExpiryTime(D2C_MESSAGE_TIMEOUT); System.out.println(msgStr); EventCallback eventCallback = new EventCallback();
errorInjectionMessage.setExpiryTime(100); MessageAndResult errorInjectionMsgAndRet = new MessageAndResult(errorInjectionMessage, null); IotHubServicesCommon.sendMessageAndWaitForResponse(internalClient,
public void errorInjectionSendReportedPropertiesFlow(Message errorInjectionMessage) throws Exception { // Arrange List<com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair<IotHubConnectionStatus, Throwable>> actualStatusUpdates = new ArrayList<>(); setConnectionStatusCallBack(actualStatusUpdates); sendReportedPropertiesAndVerify(1); // Act errorInjectionMessage.setExpiryTime(100); MessageAndResult errorInjectionMsgAndRet = new MessageAndResult(errorInjectionMessage, null); IotHubServicesCommon.sendMessageAndWaitForResponse(internalClient, errorInjectionMsgAndRet, RETRY_MILLISECONDS, SEND_TIMEOUT_MILLISECONDS, this.testInstance.protocol); // Assert IotHubServicesCommon.waitForStabilizedConnection(actualStatusUpdates, ERROR_INJECTION_WAIT_TIMEOUT, internalClient); // add one new reported property deviceUnderTest.dCDeviceForTwin.createNewReportedProperties(1); internalClient.sendReportedProperties(deviceUnderTest.dCDeviceForTwin.getReportedProp()); waitAndVerifyTwinStatusBecomesSuccess(); // verify if they are received by SC readReportedPropertiesAndVerify(deviceUnderTest, PROPERTY_KEY, PROPERTY_VALUE, 2); } }
errorInjectionMessage.setExpiryTime(100); MessageAndResult errorInjectionMsgAndRet = new MessageAndResult(errorInjectionMessage, null); IotHubServicesCommon.sendMessageAndWaitForResponse(internalClient,
msg.setProperty("temperatureAlert", temperature > 28 ? "true" : "false"); msg.setMessageId(java.util.UUID.randomUUID().toString()); msg.setExpiryTime(D2C_MESSAGE_TIMEOUT); msg.setMessageType(MessageType.DEVICE_TELEMETRY);
errorInjectionMessage.setExpiryTime(200); testInstance.client.sendEventAsync(errorInjectionMessage, new EventCallback(null), null);