Repository: apache/flink
File: flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobClientSslTest.java (Java)

Code before:
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/** This class contains unit tests for the {@link BlobClient} with ssl enabled. */
class BlobClientSslTest extends BlobClientTest {

    /** The instance of the SSL BLOB server used during the tests. */
    private static BlobServer blobSslServer;

    /** Instance of a non-SSL BLOB server with SSL-enabled security options. */
    private static BlobServer blobNonSslServer;

    /** The SSL blob service client configuration. */
    private static Configuration sslClientConfig;

    /** The non-SSL blob service client configuration with SSL-enabled security options. */
    private static Configuration nonSslClientConfig;

    /** Starts the SSL enabled BLOB server. */
    @BeforeAll
    static void startSSLServer() throws IOException {
        Configuration config =
                SSLUtilsTest.createInternalSslConfigWithKeyAndTrustStores(
                        SecurityOptions.SSL_PROVIDER.defaultValue());
        config.set(
                SecurityOptions.SSL_ALGORITHMS,
                "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256");

        blobSslServer = TestingBlobUtils.createServer(tempDir.resolve("ssl"), config);
        blobSslServer.start();

        sslClientConfig = config;
    }

    @BeforeAll
    static void startNonSSLServer() throws IOException {
        Configuration config =
                SSLUtilsTest.createInternalSslConfigWithKeyAndTrustStores(
                        SecurityOptions.SSL_PROVIDER.defaultValue());
        config.set(BlobServerOptions.SSL_ENABLED, false);

        blobNonSslServer = TestingBlobUtils.createServer(tempDir.resolve("non_ssl"), config);
        blobNonSslServer.start();

        nonSslClientConfig = config;
    }

    /** Shuts the BLOB server down. */
    @AfterAll
    static void stopServers() throws IOException {
        if (blobSslServer != null) {
            blobSslServer.close();

Review comment (suggestion):
I think `ECDSA` is never ever tested because it became stable in java11 and not seen any effort so we can use the 2 `RSA` configs.

Code after:
import static org.assertj.core.api.Assertions.assertThatThrownBy;

/** This class contains unit tests for the {@link BlobClient} with ssl enabled. */
class BlobClientSslTest extends BlobClientTest {

    /** The instance of the SSL BLOB server used during the tests. */
    private static BlobServer blobSslServer;

    /** Instance of a non-SSL BLOB server with SSL-enabled security options. */
    private static BlobServer blobNonSslServer;

    /** The SSL blob service client configuration. */
    private static Configuration sslClientConfig;

    /** The non-SSL blob service client configuration with SSL-enabled security options. */
    private static Configuration nonSslClientConfig;

    /** Starts the SSL enabled BLOB server. */
    @BeforeAll
    static void startSSLServer() throws IOException {
        Configuration config =
                SSLUtilsTest.createInternalSslConfigWithKeyAndTrustStores(
                        SecurityOptions.SSL_PROVIDER.defaultValue());
        config.set(
                SecurityOptions.SSL_ALGORITHMS,
                "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");

        blobSslServer = TestingBlobUtils.createServer(tempDir.resolve("ssl"), config);
        blobSslServer.start();

        sslClientConfig = config;
    }

    @BeforeAll
    static void startNonSSLServer() throws IOException {
        Configuration config =
                SSLUtilsTest.createInternalSslConfigWithKeyAndTrustStores(
                        SecurityOptions.SSL_PROVIDER.defaultValue());
        config.set(BlobServerOptions.SSL_ENABLED, false);

        blobNonSslServer = TestingBlobUtils.createServer(tempDir.resolve("non_ssl"), config);
        blobNonSslServer.start();

        nonSslClientConfig = config;
    }

    /** Shuts the BLOB server down. */
    @AfterAll
    static void stopServers() throws IOException {
        if (blobSslServer != null) {
            blobSslServer.close();