ApplicationTokenCredentials constructor argument not behaving as documented
Based on the documentation for ApplicationTokenCredentials, the constructor argument environment should default to AzureEnvironment.AZURE if null is provided.
Reference: https://azure.github.io/azure-sdk-for-java/com/microsoft/azure/credentials/ApplicationTokenCredentials.html#ApplicationTokenCredentials-java.lang.String-java.lang.String-java.lang.String-com.microsoft.azure.AzureEnvironment-
However, if null is passed to the constructor, the following exception is thrown:
Exception in thread "main" java.lang.NullPointerException at com.microsoft.azure.RestClient$Builder.withBaseUrl(RestClient.java:209) at com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl.buildRestClient(AzureConfigurableImpl.java:99) at com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl.buildRestClient(AzureConfigurableImpl.java:104) at com.microsoft.azure.management.Azure$ConfigurableImpl.authenticate(Azure.java:170)
I just realized this class is a dependency that belongs to another project.