All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shaft.validation.internal.JSONValidationsBuilder Maven / Gradle / Ivy

Go to download

SHAFT is a unified test automation engine. Powered by best-in-class frameworks, SHAFT provides a wizard-like syntax to drive your automation efficiently, maximize your ROI, and minimize your learning curve. Stop reinventing the wheel. Upgrade now!

There is a newer version: 8.2.20240402
Show newest version
package com.shaft.validation.internal;

import com.shaft.validation.ValidationEnums;

@SuppressWarnings("unused")
public class JSONValidationsBuilder extends NativeValidationsBuilder {
    //TODO: implement all the methods
    public JSONValidationsBuilder(RestValidationsBuilder restValidationsBuilder) {
        super(restValidationsBuilder);
    }

    /**
     * Use this to check that the actual json response is equal to the expected json value (ignoring ordering)
     *
     * @param expectedValue the test data / expected value for the object under test
     * @return a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
     */
    public ValidationsExecutor equalsIgnoringOrder(Object expectedValue) {
        this.expectedValue = expectedValue;
        this.validationComparisonType = ValidationEnums.ValidationComparisonType.MATCHES;
        this.validationType = ValidationEnums.ValidationType.POSITIVE;
        reportMessageBuilder.append("equals \"").append(expectedValue).append("\", ignoring ordering.");
        return new ValidationsExecutor(this);
    }

    /**
     * Use this to check that the actual json response is not equal to the expected json value (ignoring ordering)
     *
     * @param expectedValue the test data / expected value for the object under test
     * @return a ValidationsExecutor object to set your custom validation message (if needed) and then perform() your validation
     */
    public ValidationsExecutor doesNotEqualIgnoringOrder(Object expectedValue) {
        this.expectedValue = expectedValue;
        this.validationComparisonType = ValidationEnums.ValidationComparisonType.MATCHES;
        this.validationType = ValidationEnums.ValidationType.NEGATIVE;
        reportMessageBuilder.append("does not equal \"").append(expectedValue).append("\", ignoring ordering.");
        return new ValidationsExecutor(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy