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

package specialwords.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 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;
import specialwords.ExtensibleStringsClient;
import specialwords.ModelPropertiesClient;
import specialwords.ModelsClient;
import specialwords.OperationsClient;
import specialwords.ParametersClient;
import specialwords.ReservedOperationBodyParamsClient;
import specialwords.SpecialWordsClientBuilder;

class SpecialWordsClientTestBase extends TestProxyTestBase {
    protected ModelsClient modelsClient;

    protected ModelPropertiesClient modelPropertiesClient;

    protected ReservedOperationBodyParamsClient reservedOperationBodyParamsClient;

    protected ExtensibleStringsClient extensibleStringsClient;

    protected OperationsClient operationsClient;

    protected ParametersClient parametersClient;

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

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

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

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

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

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

    }
}
