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

package client.structure.service.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.service.BarClient;
import client.structure.service.BazFooClient;
import client.structure.service.FooClient;
import client.structure.service.QuxBarClient;
import client.structure.service.QuxClient;
import client.structure.service.ServiceClientClient;
import client.structure.service.ServiceClientClientBuilder;
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 ServiceClientClientTestBase extends TestProxyTestBase {
    protected ServiceClientClient serviceClientClient;

    protected BazFooClient bazFooClient;

    protected QuxClient quxClient;

    protected QuxBarClient quxBarClient;

    protected FooClient fooClient;

    protected BarClient barClient;

    @Override
    protected void beforeTest() {
        ServiceClientClientBuilder serviceClientClientbuilder = new ServiceClientClientBuilder()
            .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) {
            serviceClientClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        serviceClientClient = serviceClientClientbuilder.buildClient();

        ServiceClientClientBuilder bazFooClientbuilder = new ServiceClientClientBuilder()
            .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) {
            bazFooClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        bazFooClient = bazFooClientbuilder.buildBazFooClient();

        ServiceClientClientBuilder quxClientbuilder = new ServiceClientClientBuilder()
            .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) {
            quxClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        quxClient = quxClientbuilder.buildQuxClient();

        ServiceClientClientBuilder quxBarClientbuilder = new ServiceClientClientBuilder()
            .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) {
            quxBarClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        quxBarClient = quxBarClientbuilder.buildQuxBarClient();

        ServiceClientClientBuilder fooClientbuilder = new ServiceClientClientBuilder()
            .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) {
            fooClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        fooClient = fooClientbuilder.buildFooClient();

        ServiceClientClientBuilder barClientbuilder = new ServiceClientClientBuilder()
            .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) {
            barClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        barClient = barClientbuilder.buildBarClient();

    }
}
