Skip to content

Commit e5d7a9a

Browse files
author
Changjian Wang
committed
Add environment variable check to Sample08_UpdateAnalyzerTest.setup()
Sample08_UpdateAnalyzerTest has a custom setup() method that builds a client. This method now calls skipIfRequiredEnvironmentVariablesNotSet() to skip the test when credentials are not available, preventing NullPointerException.
1 parent ee42863 commit e5d7a9a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sdk/contentunderstanding/azure-ai-contentunderstanding/src/test/java/com/azure/ai/contentunderstanding/generated/Sample08_UpdateAnalyzerTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public class Sample08_UpdateAnalyzerTest {
4242

4343
@BeforeEach
4444
public void setup() {
45+
// Skip test if required credentials are not available
46+
ContentUnderstandingClientTestBase.skipIfRequiredEnvironmentVariablesNotSet();
47+
4548
String endpoint = Configuration.getGlobalConfiguration().get("CONTENTUNDERSTANDING_ENDPOINT");
4649
String key = System.getenv("AZURE_CONTENT_UNDERSTANDING_KEY");
4750

0 commit comments

Comments
 (0)