package cz.moneta.test.dsl.wso2;

import cz.moneta.test.harness.support.rest.RawRestRequest;

public class Wso2Utils {
    private Wso2Utils() {
    }

    public static void validateResponse(RawRestRequest.Response response, int possibleStatus, boolean isGw,
                                        String gwField, String gwValue,
                                        String eiField, String eiValue) {
        if (response.getStatus() != possibleStatus) {
            response.andAssertStatus(200);
            return;
        }
        String assertField = isGw ? gwField : eiField;
        String assertValue = isGw ? gwValue : eiValue;
        response.andAssertFieldValue(assertField, assertValue);
    }
}