KhyatiVaghamshi opened a new pull request, #23388: URL: https://github.com/apache/kafka/pull/23388
## Summary Replace `File.createTempFile()` and `Files.createTempFile()` with JUnit 5 `@TempDir` annotation in clients and connect modules: * `AlterConfigsIntegrationTest.java` (clients integration tests) * `OAuthBearerTest.java` (clients — abstract base class) * `ConnectorValidationIntegrationTest.java` (connect/runtime integration tests) This removes the need for manual `@AfterEach`/`@AfterAll` cleanup and `deleteOnExit()` calls as JUnit 5 handles temporary directory lifecycle automatically. ## Changes * Added `@TempDir private Path tempDir` to `AlterConfigsIntegrationTest`, replaced `Files.createTempFile()` with `Files.createFile(tempDir.resolve(...))`, removed `@AfterEach teardown()` * Added `@TempDir protected Path tempDir` to `OAuthBearerTest` abstract base class, replaced `File.createTempFile()` in `generatePrivateKey()` * Added `@TempDir private static Path tempDir` to `ConnectorValidationIntegrationTest`, replaced `Files.createTempFile()` in `@BeforeAll setup()` and `testValidationErrorMessagesDoNotContainResolvedValueOnValidatorRejection()`, removed manual cleanup in `@AfterAll close()` ## Intentionally excluded * `ClientAssertionKeycloakIntegrationTest` — static lifecycle tied to Docker container setup/teardown with explicit finally-block cleanup; not a clean `@TempDir` conversion * `TestPlugins` — static initializer in a utility class, not a test class ## Scope This is a follow-up to #23280 (connect module) and #23381 (generator, tools, test-common). This PR covers the remaining clients and connect files that are clean `@TempDir` conversions. ## Test plan * `OAuthBearerTest` subclasses — all tests pass * `AlterConfigsIntegrationTest` — verified compilation * `ConnectorValidationIntegrationTest` — verified compilation * Checkstyle and Spotless checks pass Reviewers: Uros (github:uros-b) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
