// Path: src/main/java/com/yelp/clientlib/exception/exceptions/BusinessUnavailable.java
// public class BusinessUnavailable extends YelpAPIError {
//     public BusinessUnavailable(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/InternalError.java
// public class InternalError extends YelpAPIError {
//     public InternalError(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/InvalidParameter.java
// public class InvalidParameter extends YelpAPIError {
//     public InvalidParameter(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/UnexpectedAPIError.java
// public class UnexpectedAPIError extends YelpAPIError {
//     public UnexpectedAPIError(int code, String message) {
//         this(code, message, null, null);
//     }
// 
//     public UnexpectedAPIError(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/test/java/com/yelp/clientlib/utils/ErrorTestUtils.java
// public class ErrorTestUtils {
// 
//     /**
//      * Verify a {@link YelpAPIError} contains correct information.
//      *
//      * @param error         The YelpAPIError to be verified.
//      * @param expectCode    Expected error code.
//      * @param expectMessage Expected error message.
//      * @param expectId      Expected error Id.
//      * @param expectText    Expected error text.
//      */
//     public static void verifyErrorContent(
//             YelpAPIError error,
//             int expectCode,
//             String expectMessage,
//             String expectId,
//             String expectText
//     ) {
//         Assert.assertEquals(expectCode, error.getCode());
//         Assert.assertEquals(expectMessage, error.getMessage());
//         Assert.assertEquals(expectId, error.getErrorId());
//         Assert.assertEquals(expectText, error.getText());
//     }
// }


import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import com.yelp.clientlib.exception.exceptions.BusinessUnavailable;
import com.yelp.clientlib.exception.exceptions.InternalError;
import com.yelp.clientlib.exception.exceptions.InvalidParameter;
import com.yelp.clientlib.exception.exceptions.UnexpectedAPIError;
import com.yelp.clientlib.utils.ErrorTestUtils;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.io.IOException;
    @Test
    public void testParseBusinessUnavailable() throws IOException {
        int errorCode = 400;
        String errorMessage = "Bad Request";
        String errorId = "BUSINESS_UNAVAILABLE";
        String errorText = "Business information is unavailable";
        String errorJsonBody = generateErrorJsonString(errorId, errorText);

        Interceptor.Chain mockChain = mockChainWithErrorResponse(errorCode, errorMessage, errorJsonBody);
        try {
            errorHandlingInterceptor.intercept(mockChain);
        } catch (BusinessUnavailable error) {
            ErrorTestUtils.verifyErrorContent(error, errorCode, errorMessage, errorId, errorText);
            return;
        }

        Assert.fail("Expected failure not returned.");
    }

    @Test
    public void testParseInternalError() throws IOException {
        int errorCode = 500;
        String errorMessage = "Internal Server Error";
        String errorId = "INTERNAL_ERROR";
        String errorText = "Some internal error happened";
        String errorJsonBody = generateErrorJsonString(errorId, errorText);

        Interceptor.Chain mockChain = mockChainWithErrorResponse(errorCode, errorMessage, errorJsonBody);
        try {
            errorHandlingInterceptor.intercept(mockChain);
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/BusinessUnavailable.java
// public class BusinessUnavailable extends YelpAPIError {
//     public BusinessUnavailable(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/InternalError.java
// public class InternalError extends YelpAPIError {
//     public InternalError(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/InvalidParameter.java
// public class InvalidParameter extends YelpAPIError {
//     public InvalidParameter(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/main/java/com/yelp/clientlib/exception/exceptions/UnexpectedAPIError.java
// public class UnexpectedAPIError extends YelpAPIError {
//     public UnexpectedAPIError(int code, String message) {
//         this(code, message, null, null);
//     }
// 
//     public UnexpectedAPIError(int code, String message, String id, String text) {
//         super(code, message, id, text);
//     }
// }
// 
// Path: src/test/java/com/yelp/clientlib/utils/ErrorTestUtils.java
// public class ErrorTestUtils {
// 
//     /**
//      * Verify a {@link YelpAPIError} contains correct information.
//      *
//      * @param error         The YelpAPIError to be verified.
//      * @param expectCode    Expected error code.
//      * @param expectMessage Expected error message.
//      * @param expectId      Expected error Id.
//      * @param expectText    Expected error text.
//      */
//     public static void verifyErrorContent(
//             YelpAPIError error,
//             int expectCode,
//             String expectMessage,
//             String expectId,
//             String expectText
//     ) {
//         Assert.assertEquals(expectCode, error.getCode());
//         Assert.assertEquals(expectMessage, error.getMessage());
//         Assert.assertEquals(expectId, error.getErrorId());
//         Assert.assertEquals(expectText, error.getText());
//     }
// }


// Path: src/test/java/com/yelp/clientlib/exception/ErrorHandlingInterceptorTest.java
import okhttp3.Interceptor;
import okhttp3.MediaType;
import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.ResponseBody;
import com.yelp.clientlib.exception.exceptions.BusinessUnavailable;
import com.yelp.clientlib.exception.exceptions.InternalError;
import com.yelp.clientlib.exception.exceptions.InvalidParameter;
import com.yelp.clientlib.exception.exceptions.UnexpectedAPIError;
import com.yelp.clientlib.utils.ErrorTestUtils;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.io.IOException;

    @Test
    public void testParseBusinessUnavailable() throws IOException {
        int errorCode = 400;
        String errorMessage = "Bad Request";
        String errorId = "BUSINESS_UNAVAILABLE";
        String errorText = "Business information is unavailable";
        String errorJsonBody = generateErrorJsonString(errorId, errorText);

        Interceptor.Chain mockChain = mockChainWithErrorResponse(errorCode, errorMessage, errorJsonBody);
        try {
            errorHandlingInterceptor.intercept(mockChain);
        } catch (BusinessUnavailable error) {
            ErrorTestUtils.verifyErrorContent(error, errorCode, errorMessage, errorId, errorText);
            return;
        }

        Assert.fail("Expected failure not returned.");
    }

    @Test
    public void testParseInternalError() throws IOException {
        int errorCode = 500;
        String errorMessage = "Internal Server Error";
        String errorId = "INTERNAL_ERROR";
        String errorText = "Some internal error happened";
        String errorJsonBody = generateErrorJsonString(errorId, errorText);

        Interceptor.Chain mockChain = mockChainWithErrorResponse(errorCode, errorMessage, errorJsonBody);
        try {
            errorHandlingInterceptor.intercept(mockChain);
        } catch (InternalError error) {