// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package azure.clientgenerator.core.methodoverride.generated;

// The Java test files under 'generated' package are generated for your reference.
// If you wish to modify these files, please copy them out of the 'generated' package, and modify there.
// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test.

import azure.clientgenerator.core.methodoverride.GroupParametersClient;
import azure.clientgenerator.core.methodoverride.OverrideClientBuilder;
import azure.clientgenerator.core.methodoverride.RemoveOptionalParameterClient;
import azure.clientgenerator.core.methodoverride.ReorderParametersClient;
import azure.clientgenerator.core.methodoverride.RequireOptionalParameterClient;
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.test.TestMode;
import com.azure.core.test.TestProxyTestBase;
import com.azure.core.util.Configuration;

class OverrideClientTestBase extends TestProxyTestBase {
    protected ReorderParametersClient reorderParametersClient;

    protected GroupParametersClient groupParametersClient;

    protected RequireOptionalParameterClient requireOptionalParameterClient;

    protected RemoveOptionalParameterClient removeOptionalParameterClient;

    @Override
    protected void beforeTest() {
        OverrideClientBuilder reorderParametersClientbuilder = new OverrideClientBuilder()
            .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000"))
            .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
            .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            reorderParametersClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        reorderParametersClient = reorderParametersClientbuilder.buildReorderParametersClient();

        OverrideClientBuilder groupParametersClientbuilder = new OverrideClientBuilder()
            .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000"))
            .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
            .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            groupParametersClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        groupParametersClient = groupParametersClientbuilder.buildGroupParametersClient();

        OverrideClientBuilder requireOptionalParameterClientbuilder = new OverrideClientBuilder()
            .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000"))
            .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
            .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            requireOptionalParameterClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        requireOptionalParameterClient = requireOptionalParameterClientbuilder.buildRequireOptionalParameterClient();

        OverrideClientBuilder removeOptionalParameterClientbuilder = new OverrideClientBuilder()
            .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "http://localhost:3000"))
            .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
            .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            removeOptionalParameterClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        removeOptionalParameterClient = removeOptionalParameterClientbuilder.buildRemoveOptionalParameterClient();

    }
}
