Search in sources :

Example 16 with StandardTierHubOnlyTest

use of tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest in project azure-iot-sdk-java by Azure.

the class DigitalTwinClientTests method digitalTwinConstructorThrowsForNegativeConnectTimeout.

@Test(expected = IllegalArgumentException.class)
@StandardTierHubOnlyTest
public void digitalTwinConstructorThrowsForNegativeConnectTimeout() {
    // arrange
    DigitalTwinClientOptions clientOptions = DigitalTwinClientOptions.builder().httpConnectTimeout(-1).build();
    digitalTwinClient = new DigitalTwinClient(IOTHUB_CONNECTION_STRING, clientOptions);
}
Also used : DigitalTwinClientOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClientOptions) DigitalTwinClient(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClient) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) Test(org.junit.Test)

Example 17 with StandardTierHubOnlyTest

use of tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest in project azure-iot-sdk-java by Azure.

the class DigitalTwinClientTests method updateDigitalTwin.

@Test
@StandardTierHubOnlyTest
public void updateDigitalTwin() throws IOException {
    // arrange
    String newProperty = "currentTemperature";
    String newPropertyPath = "/currentTemperature";
    Integer newPropertyValue = 35;
    // Property update callback
    TwinPropertyCallBack twinPropertyCallBack = (property, context) -> {
        Set<Property> properties = new HashSet<>();
        properties.add(property);
        try {
            deviceClient.sendReportedProperties(properties);
        } catch (IOException e) {
        }
    };
    // IotHub event callback
    IotHubEventCallback iotHubEventCallback = (responseStatus, callbackContext) -> {
    };
    // start device twin and setup handler for property updates in device
    deviceClient.startDeviceTwin(iotHubEventCallback, null, twinPropertyCallBack, null);
    Map<Property, Pair<TwinPropertyCallBack, Object>> desiredPropertyUpdateCallback = Collections.singletonMap(new Property(newProperty, null), new Pair<>(twinPropertyCallBack, null));
    deviceClient.subscribeToTwinDesiredProperties(desiredPropertyUpdateCallback);
    DigitalTwinUpdateRequestOptions optionsWithoutEtag = new DigitalTwinUpdateRequestOptions();
    optionsWithoutEtag.setIfMatch("*");
    // get digital twin and Etag before update
    ServiceResponseWithHeaders<BasicDigitalTwin, DigitalTwinGetHeaders> responseWithHeaders = digitalTwinClient.getDigitalTwinWithResponse(deviceId, BasicDigitalTwin.class);
    DigitalTwinUpdateRequestOptions optionsWithEtag = new DigitalTwinUpdateRequestOptions();
    optionsWithEtag.setIfMatch(responseWithHeaders.headers().eTag());
    // act
    // Add properties at root level - conditional update with max overload
    UpdateOperationUtility updateOperationUtility = new UpdateOperationUtility().appendAddPropertyOperation(newPropertyPath, newPropertyValue);
    digitalTwinClient.updateDigitalTwinWithResponse(deviceId, updateOperationUtility.getUpdateOperations(), optionsWithEtag);
    BasicDigitalTwin digitalTwin = digitalTwinClient.getDigitalTwinWithResponse(deviceId, BasicDigitalTwin.class).body();
    // assert
    assertEquals(E2ETestConstants.THERMOSTAT_MODEL_ID, digitalTwin.getMetadata().getModelId());
    assertTrue(digitalTwin.getMetadata().getWriteableProperties().containsKey(newProperty));
    assertEquals(newPropertyValue, digitalTwin.getMetadata().getWriteableProperties().get(newProperty).getDesiredValue());
}
Also used : IotHubServiceSasToken(com.microsoft.azure.sdk.iot.service.auth.IotHubServiceSasToken) Device(com.microsoft.azure.sdk.iot.service.Device) SasTokenTools(tests.integration.com.microsoft.azure.sdk.iot.helpers.SasTokenTools) Arrays(java.util.Arrays) MultiplexingClient(com.microsoft.azure.sdk.iot.device.MultiplexingClient) ClientOptions(com.microsoft.azure.sdk.iot.device.ClientOptions) DigitalTwinClient(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClient) IotHubClientProtocol(com.microsoft.azure.sdk.iot.device.IotHubClientProtocol) URISyntaxException(java.net.URISyntaxException) ZonedDateTime(java.time.ZonedDateTime) DigitalTwinClientOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClientOptions) MultiplexingClientException(com.microsoft.azure.sdk.iot.device.exceptions.MultiplexingClientException) ProxyOptions(com.microsoft.azure.sdk.iot.service.ProxyOptions) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) DigitalTwinCommandResponse(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinCommandResponse) Proxy(java.net.Proxy) After(org.junit.After) Map(java.util.Map) DeviceClient(com.microsoft.azure.sdk.iot.device.DeviceClient) ZoneOffset(java.time.ZoneOffset) DefaultHttpProxyServer(org.littleshoot.proxy.impl.DefaultHttpProxyServer) Parameterized(org.junit.runners.Parameterized) AfterClass(org.junit.AfterClass) Tools(tests.integration.com.microsoft.azure.sdk.iot.helpers.Tools) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) AzureSasCredential(com.azure.core.credential.AzureSasCredential) DeviceMethodCallback(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback) TwinPropertyCallBack(com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) Collection(java.util.Collection) Set(java.util.Set) UUID(java.util.UUID) DigitalTwinInvokeCommandHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinInvokeCommandHeaders) InetSocketAddress(java.net.InetSocketAddress) StandardCharsets(java.nio.charset.StandardCharsets) UpdateOperationUtility(com.microsoft.azure.sdk.iot.service.digitaltwin.UpdateOperationUtility) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) TokenCredential(com.azure.core.credential.TokenCredential) DigitalTwinInvokeCommandRequestOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinInvokeCommandRequestOptions) HttpProxyServer(org.littleshoot.proxy.HttpProxyServer) DeviceMethodData(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodData) BeforeClass(org.junit.BeforeClass) RegistryManagerOptions(com.microsoft.azure.sdk.iot.service.RegistryManagerOptions) RunWith(org.junit.runner.RunWith) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) RegistryManager(com.microsoft.azure.sdk.iot.service.RegistryManager) DigitalTwinGetHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.customized.DigitalTwinGetHeaders) DigitalTwinUpdateRequestOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinUpdateRequestOptions) ArrayList(java.util.ArrayList) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) HashSet(java.util.HashSet) RestException(com.microsoft.rest.RestException) Timeout(org.junit.rules.Timeout) IotHubEventCallback(com.microsoft.azure.sdk.iot.device.IotHubEventCallback) Pair(com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair) BasicDigitalTwin(com.microsoft.azure.sdk.iot.service.digitaltwin.serialization.BasicDigitalTwin) Before(org.junit.Before) Property(com.microsoft.azure.sdk.iot.device.DeviceTwin.Property) TestCase.fail(junit.framework.TestCase.fail) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) E2ETestConstants(tests.integration.com.microsoft.azure.sdk.iot.digitaltwin.helpers.E2ETestConstants) AuthenticationType(com.microsoft.azure.sdk.iot.service.auth.AuthenticationType) Rule(org.junit.Rule) Ignore(org.junit.Ignore) IotHubConnectionStringBuilder(com.microsoft.azure.sdk.iot.service.IotHubConnectionStringBuilder) DateTimeFormatter(java.time.format.DateTimeFormatter) IotHubException(com.microsoft.azure.sdk.iot.service.exceptions.IotHubException) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) IotHubEventCallback(com.microsoft.azure.sdk.iot.device.IotHubEventCallback) UpdateOperationUtility(com.microsoft.azure.sdk.iot.service.digitaltwin.UpdateOperationUtility) Set(java.util.Set) HashSet(java.util.HashSet) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) IOException(java.io.IOException) DigitalTwinUpdateRequestOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinUpdateRequestOptions) BasicDigitalTwin(com.microsoft.azure.sdk.iot.service.digitaltwin.serialization.BasicDigitalTwin) DigitalTwinGetHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.customized.DigitalTwinGetHeaders) TwinPropertyCallBack(com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack) Property(com.microsoft.azure.sdk.iot.device.DeviceTwin.Property) Pair(com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) Test(org.junit.Test)

Example 18 with StandardTierHubOnlyTest

use of tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest in project azure-iot-sdk-java by Azure.

the class DigitalTwinClientTests method digitalTwinClientTokenRenewalWithAzureSasCredential.

@Test
@StandardTierHubOnlyTest
public void digitalTwinClientTokenRenewalWithAzureSasCredential() {
    if (protocol != MQTT) {
        // This test is for the service client, so no need to rerun it for all the different device protocols
        return;
    }
    IotHubConnectionString iotHubConnectionStringObj = IotHubConnectionStringBuilder.createIotHubConnectionString(IOTHUB_CONNECTION_STRING);
    IotHubServiceSasToken serviceSasToken = new IotHubServiceSasToken(iotHubConnectionStringObj);
    AzureSasCredential sasCredential = new AzureSasCredential(serviceSasToken.toString());
    digitalTwinClient = new DigitalTwinClient(iotHubConnectionStringObj.getHostName(), sasCredential);
    // get a digital twin with a valid SAS token in the AzureSasCredential instance
    // don't care about the return value, just checking that the request isn't unauthorized
    digitalTwinClient.getDigitalTwin(deviceId, BasicDigitalTwin.class);
    // deliberately expire the SAS token to provoke a 401 to ensure that the digital twin client is using the shared
    // access signature that is set here.
    sasCredential.update(SasTokenTools.makeSasTokenExpired(serviceSasToken.toString()));
    try {
        digitalTwinClient.getDigitalTwin(deviceId, BasicDigitalTwin.class);
        fail("Expected get digital twin call to throw unauthorized exception since an expired SAS token was used, but no exception was thrown");
    } catch (RestException e) {
        if (e.response().code() == 401) {
            log.debug("IotHubUnauthorizedException was thrown as expected, continuing test");
        } else {
            throw e;
        }
    }
    // Renew the expired shared access signature
    serviceSasToken = new IotHubServiceSasToken(iotHubConnectionStringObj);
    sasCredential.update(serviceSasToken.toString());
    // get a digital twin using the renewed shared access signature
    // don't care about the return value, just checking that the request isn't unauthorized
    digitalTwinClient.getDigitalTwin(deviceId, BasicDigitalTwin.class);
}
Also used : IotHubServiceSasToken(com.microsoft.azure.sdk.iot.service.auth.IotHubServiceSasToken) AzureSasCredential(com.azure.core.credential.AzureSasCredential) RestException(com.microsoft.rest.RestException) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) DigitalTwinClient(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClient) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) Test(org.junit.Test)

Example 19 with StandardTierHubOnlyTest

use of tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest in project azure-iot-sdk-java by Azure.

the class DigitalTwinClientTests method getMultiplexedDigitalTwinsRegisteredAfterOpen.

// Open a multiplexed connection with no devices, then register two devices, each with a different model Id.
// Verify that their reported twin has the expected model Ids.
@Test
@StandardTierHubOnlyTest
public void getMultiplexedDigitalTwinsRegisteredAfterOpen() throws IotHubException, IOException, URISyntaxException, MultiplexingClientException, InterruptedException {
    if (protocol == MQTT || protocol == MQTT_WS) {
        // multiplexing isn't supported over MQTT, so it can't be tested
        return;
    }
    MultiplexingClient multiplexingClient = new MultiplexingClient(deviceClient.getConfig().getIotHubHostname(), protocol);
    List<DeviceClient> multiplexedDeviceClients = new ArrayList<>();
    multiplexedDeviceClients.add(createDeviceClient(protocol, E2ETestConstants.THERMOSTAT_MODEL_ID));
    multiplexedDeviceClients.add(createDeviceClient(protocol, E2ETestConstants.TEMPERATURE_CONTROLLER_MODEL_ID));
    multiplexingClient.open();
    // register the devices after the multiplexing client has been opened
    multiplexingClient.registerDeviceClients(multiplexedDeviceClients);
    // act
    String thermostatDeviceId = multiplexedDeviceClients.get(0).getConfig().getDeviceId();
    BasicDigitalTwin thermostatResponse = digitalTwinClient.getDigitalTwin(thermostatDeviceId, BasicDigitalTwin.class);
    ServiceResponseWithHeaders<BasicDigitalTwin, DigitalTwinGetHeaders> thermostatResponseWithHeaders = digitalTwinClient.getDigitalTwinWithResponse(thermostatDeviceId, BasicDigitalTwin.class);
    String temperatureControllerDeviceId = multiplexedDeviceClients.get(1).getConfig().getDeviceId();
    BasicDigitalTwin temperatureControllerResponse = digitalTwinClient.getDigitalTwin(temperatureControllerDeviceId, BasicDigitalTwin.class);
    ServiceResponseWithHeaders<BasicDigitalTwin, DigitalTwinGetHeaders> temperatureControllerResponseWithHeaders = digitalTwinClient.getDigitalTwinWithResponse(temperatureControllerDeviceId, BasicDigitalTwin.class);
    // assert
    assertEquals(thermostatResponse.getMetadata().getModelId(), E2ETestConstants.THERMOSTAT_MODEL_ID);
    assertEquals(thermostatResponseWithHeaders.body().getMetadata().getModelId(), E2ETestConstants.THERMOSTAT_MODEL_ID);
    assertEquals(temperatureControllerResponse.getMetadata().getModelId(), E2ETestConstants.TEMPERATURE_CONTROLLER_MODEL_ID);
    assertEquals(temperatureControllerResponseWithHeaders.body().getMetadata().getModelId(), E2ETestConstants.TEMPERATURE_CONTROLLER_MODEL_ID);
}
Also used : BasicDigitalTwin(com.microsoft.azure.sdk.iot.service.digitaltwin.serialization.BasicDigitalTwin) DeviceClient(com.microsoft.azure.sdk.iot.device.DeviceClient) ArrayList(java.util.ArrayList) DigitalTwinGetHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.customized.DigitalTwinGetHeaders) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) MultiplexingClient(com.microsoft.azure.sdk.iot.device.MultiplexingClient) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) Test(org.junit.Test)

Example 20 with StandardTierHubOnlyTest

use of tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest in project azure-iot-sdk-java by Azure.

the class DigitalTwinClientTests method invokeRootLevelCommand.

@Test
@StandardTierHubOnlyTest
public void invokeRootLevelCommand() throws IOException {
    // arrange
    String commandName = "getMaxMinReport";
    String commandInput = "\"" + ZonedDateTime.now(ZoneOffset.UTC).minusMinutes(5).format(DateTimeFormatter.ISO_DATE_TIME) + "\"";
    String jsonStringInput = "{\"prop\":\"value\"}";
    DigitalTwinInvokeCommandRequestOptions options = new DigitalTwinInvokeCommandRequestOptions();
    options.setConnectTimeoutInSeconds(15);
    options.setResponseTimeoutInSeconds(15);
    // setup device callback
    Integer deviceSuccessResponseStatus = 200;
    Integer deviceFailureResponseStatus = 500;
    // Device method callback
    DeviceMethodCallback deviceMethodCallback = (methodName, methodData, context) -> {
        String jsonRequest = new String((byte[]) methodData, StandardCharsets.UTF_8);
        if (methodName.equalsIgnoreCase(commandName)) {
            return new DeviceMethodData(deviceSuccessResponseStatus, jsonRequest);
        } else {
            return new DeviceMethodData(deviceFailureResponseStatus, jsonRequest);
        }
    };
    // IotHub event callback
    IotHubEventCallback iotHubEventCallback = (responseStatus, callbackContext) -> {
    };
    deviceClient.subscribeToDeviceMethod(deviceMethodCallback, commandName, iotHubEventCallback, commandName);
    // act
    DigitalTwinCommandResponse responseWithNoPayload = this.digitalTwinClient.invokeCommand(deviceId, commandName, null);
    DigitalTwinCommandResponse responseWithJsonStringPayload = this.digitalTwinClient.invokeCommand(deviceId, commandName, jsonStringInput);
    DigitalTwinCommandResponse responseWithDatePayload = this.digitalTwinClient.invokeCommand(deviceId, commandName, commandInput);
    ServiceResponseWithHeaders<DigitalTwinCommandResponse, DigitalTwinInvokeCommandHeaders> datePayloadResponseWithHeaders = this.digitalTwinClient.invokeCommandWithResponse(deviceId, commandName, commandInput, options);
    // assert
    assertEquals(deviceSuccessResponseStatus, responseWithNoPayload.getStatus());
    assertEquals("\"\"", responseWithNoPayload.getPayload());
    assertEquals(deviceSuccessResponseStatus, responseWithJsonStringPayload.getStatus());
    assertEquals(jsonStringInput, responseWithJsonStringPayload.getPayload());
    assertEquals(deviceSuccessResponseStatus, responseWithDatePayload.getStatus());
    assertEquals(commandInput, responseWithDatePayload.getPayload());
    assertEquals(deviceSuccessResponseStatus, datePayloadResponseWithHeaders.body().getStatus());
    assertEquals(commandInput, datePayloadResponseWithHeaders.body().getPayload());
}
Also used : IotHubServiceSasToken(com.microsoft.azure.sdk.iot.service.auth.IotHubServiceSasToken) Device(com.microsoft.azure.sdk.iot.service.Device) SasTokenTools(tests.integration.com.microsoft.azure.sdk.iot.helpers.SasTokenTools) Arrays(java.util.Arrays) MultiplexingClient(com.microsoft.azure.sdk.iot.device.MultiplexingClient) ClientOptions(com.microsoft.azure.sdk.iot.device.ClientOptions) DigitalTwinClient(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClient) IotHubClientProtocol(com.microsoft.azure.sdk.iot.device.IotHubClientProtocol) URISyntaxException(java.net.URISyntaxException) ZonedDateTime(java.time.ZonedDateTime) DigitalTwinClientOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClientOptions) MultiplexingClientException(com.microsoft.azure.sdk.iot.device.exceptions.MultiplexingClientException) ProxyOptions(com.microsoft.azure.sdk.iot.service.ProxyOptions) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) DigitalTwinCommandResponse(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinCommandResponse) Proxy(java.net.Proxy) After(org.junit.After) Map(java.util.Map) DeviceClient(com.microsoft.azure.sdk.iot.device.DeviceClient) ZoneOffset(java.time.ZoneOffset) DefaultHttpProxyServer(org.littleshoot.proxy.impl.DefaultHttpProxyServer) Parameterized(org.junit.runners.Parameterized) AfterClass(org.junit.AfterClass) Tools(tests.integration.com.microsoft.azure.sdk.iot.helpers.Tools) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) AzureSasCredential(com.azure.core.credential.AzureSasCredential) DeviceMethodCallback(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback) TwinPropertyCallBack(com.microsoft.azure.sdk.iot.device.DeviceTwin.TwinPropertyCallBack) ServiceResponseWithHeaders(com.microsoft.rest.ServiceResponseWithHeaders) Collection(java.util.Collection) Set(java.util.Set) UUID(java.util.UUID) DigitalTwinInvokeCommandHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinInvokeCommandHeaders) InetSocketAddress(java.net.InetSocketAddress) StandardCharsets(java.nio.charset.StandardCharsets) UpdateOperationUtility(com.microsoft.azure.sdk.iot.service.digitaltwin.UpdateOperationUtility) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) TokenCredential(com.azure.core.credential.TokenCredential) DigitalTwinInvokeCommandRequestOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinInvokeCommandRequestOptions) HttpProxyServer(org.littleshoot.proxy.HttpProxyServer) DeviceMethodData(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodData) BeforeClass(org.junit.BeforeClass) RegistryManagerOptions(com.microsoft.azure.sdk.iot.service.RegistryManagerOptions) RunWith(org.junit.runner.RunWith) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) RegistryManager(com.microsoft.azure.sdk.iot.service.RegistryManager) DigitalTwinGetHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.customized.DigitalTwinGetHeaders) DigitalTwinUpdateRequestOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinUpdateRequestOptions) ArrayList(java.util.ArrayList) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) HashSet(java.util.HashSet) RestException(com.microsoft.rest.RestException) Timeout(org.junit.rules.Timeout) IotHubEventCallback(com.microsoft.azure.sdk.iot.device.IotHubEventCallback) Pair(com.microsoft.azure.sdk.iot.device.DeviceTwin.Pair) BasicDigitalTwin(com.microsoft.azure.sdk.iot.service.digitaltwin.serialization.BasicDigitalTwin) Before(org.junit.Before) Property(com.microsoft.azure.sdk.iot.device.DeviceTwin.Property) TestCase.fail(junit.framework.TestCase.fail) Assert.assertTrue(org.junit.Assert.assertTrue) Test(org.junit.Test) IOException(java.io.IOException) E2ETestConstants(tests.integration.com.microsoft.azure.sdk.iot.digitaltwin.helpers.E2ETestConstants) AuthenticationType(com.microsoft.azure.sdk.iot.service.auth.AuthenticationType) Rule(org.junit.Rule) Ignore(org.junit.Ignore) IotHubConnectionStringBuilder(com.microsoft.azure.sdk.iot.service.IotHubConnectionStringBuilder) DateTimeFormatter(java.time.format.DateTimeFormatter) IotHubException(com.microsoft.azure.sdk.iot.service.exceptions.IotHubException) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) IotHubEventCallback(com.microsoft.azure.sdk.iot.device.IotHubEventCallback) DigitalTwinCommandResponse(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinCommandResponse) DigitalTwinInvokeCommandHeaders(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinInvokeCommandHeaders) DeviceMethodData(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodData) IotHubConnectionString(com.microsoft.azure.sdk.iot.service.IotHubConnectionString) DigitalTwinInvokeCommandRequestOptions(com.microsoft.azure.sdk.iot.service.digitaltwin.models.DigitalTwinInvokeCommandRequestOptions) DeviceMethodCallback(com.microsoft.azure.sdk.iot.device.DeviceTwin.DeviceMethodCallback) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) DigitalTwinTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest) IntegrationTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest) StandardTierHubOnlyTest(tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest) Test(org.junit.Test)

Aggregations

StandardTierHubOnlyTest (tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.StandardTierHubOnlyTest)45 Test (org.junit.Test)40 IotHubTest (tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.IotHubTest)32 IntegrationTest (tests.integration.com.microsoft.azure.sdk.iot.helpers.IntegrationTest)31 ContinuousIntegrationTest (tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.ContinuousIntegrationTest)28 IotHubConnectionString (com.microsoft.azure.sdk.iot.service.IotHubConnectionString)19 DigitalTwinTest (tests.integration.com.microsoft.azure.sdk.iot.helpers.annotations.DigitalTwinTest)12 AzureSasCredential (com.azure.core.credential.AzureSasCredential)10 IotHubServiceSasToken (com.microsoft.azure.sdk.iot.service.auth.IotHubServiceSasToken)10 DigitalTwinGetHeaders (com.microsoft.azure.sdk.iot.service.digitaltwin.customized.DigitalTwinGetHeaders)9 BasicDigitalTwin (com.microsoft.azure.sdk.iot.service.digitaltwin.serialization.BasicDigitalTwin)9 Device (com.microsoft.azure.sdk.iot.service.Device)8 IOException (java.io.IOException)8 DeviceTwinDevice (com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwinDevice)7 Pair (com.microsoft.azure.sdk.iot.service.devicetwin.Pair)7 Property (com.microsoft.azure.sdk.iot.device.DeviceTwin.Property)6 DeviceTwin (com.microsoft.azure.sdk.iot.service.devicetwin.DeviceTwin)6 DigitalTwinClient (com.microsoft.azure.sdk.iot.service.digitaltwin.DigitalTwinClient)6 DeviceClient (com.microsoft.azure.sdk.iot.device.DeviceClient)5 ProxyOptions (com.microsoft.azure.sdk.iot.service.ProxyOptions)5