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

package client.structure.clientoperationgroup.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 client.structure.anotherclientoperationgroup.subnamespace.Group5Client;
import client.structure.anotherclientoperationgroup.subnamespace.SecondClient;
import client.structure.anotherclientoperationgroup.subnamespace.SecondClientBuilder;
import client.structure.clientoperationgroup.FirstClient;
import client.structure.clientoperationgroup.FirstClientBuilder;
import client.structure.clientoperationgroup.Group3Client;
import client.structure.clientoperationgroup.Group4Client;
import client.structure.service.models.ClientType;
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 FirstClientTestBase extends TestProxyTestBase {
    protected FirstClient firstClient;

    protected Group3Client group3Client;

    protected Group4Client group4Client;

    protected SecondClient secondClient;

    protected Group5Client group5Client;

    @Override
    protected void beforeTest() {
        FirstClientBuilder firstClientbuilder
            = new FirstClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
                .client(ClientType.fromString(Configuration.getGlobalConfiguration().get("CLIENT", "client")))
                .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
                .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            firstClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        firstClient = firstClientbuilder.buildClient();

        FirstClientBuilder group3Clientbuilder
            = new FirstClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
                .client(ClientType.fromString(Configuration.getGlobalConfiguration().get("CLIENT", "client")))
                .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
                .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            group3Clientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        group3Client = group3Clientbuilder.buildGroup3Client();

        FirstClientBuilder group4Clientbuilder
            = new FirstClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
                .client(ClientType.fromString(Configuration.getGlobalConfiguration().get("CLIENT", "client")))
                .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
                .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            group4Clientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        group4Client = group4Clientbuilder.buildGroup4Client();

        SecondClientBuilder secondClientbuilder
            = new SecondClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
                .client(ClientType.fromString(Configuration.getGlobalConfiguration().get("CLIENT", "client")))
                .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
                .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            secondClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        secondClient = secondClientbuilder.buildClient();

        SecondClientBuilder group5Clientbuilder
            = new SecondClientBuilder().endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint"))
                .client(ClientType.fromString(Configuration.getGlobalConfiguration().get("CLIENT", "client")))
                .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null)))
                .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.RECORD) {
            group5Clientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        group5Client = group5Clientbuilder.buildGroup5Client();

    }
}
