tsp-output/@azure-tools/typespec-java/src/test/java/com/notificationhubs/generated/NotificationHubsClientTestBase.java
<filename>tsp-output/@azure-tools/typespec-java/src/test/java/com/notificationhubs/generated/NotificationHubsClientTestBase.java// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.notificationhubs.generated;

import com.azure.core.http.HttpClient;
import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.test.TestBase;
import com.azure.core.test.TestMode;
import com.azure.core.util.Configuration;
import com.notificationhubs.NotificationHubsClient;
import com.notificationhubs.NotificationHubsClientBuilder;

class NotificationHubsClientTestBase extends TestBase {
    protected NotificationHubsClient notificationHubsClient;

    @Override
    protected void beforeTest() {
        NotificationHubsClientBuilder notificationHubsClientbuilder =
                new NotificationHubsClientBuilder()
                        .namespaceName(Configuration.getGlobalConfiguration().get("NAMESPACENAME", "namespacename"))
                        .hubName(Configuration.getGlobalConfiguration().get("HUBNAME", "hubname"))
                        .httpClient(HttpClient.createDefault())
                        .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC));
        if (getTestMode() == TestMode.PLAYBACK) {
            notificationHubsClientbuilder.httpClient(interceptorManager.getPlaybackClient());
        } else if (getTestMode() == TestMode.RECORD) {
            notificationHubsClientbuilder.addPolicy(interceptorManager.getRecordPolicy());
        }
        notificationHubsClient = notificationHubsClientbuilder.buildClient();
    }
}
