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

com.github.dreamhead.moco.verification.AbstractTimesVerification Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
package com.github.dreamhead.moco.verification;

import com.github.dreamhead.moco.VerificationData;
import com.github.dreamhead.moco.VerificationException;
import com.github.dreamhead.moco.VerificationMode;

public abstract class AbstractTimesVerification implements VerificationMode {
    protected abstract boolean meet(final int size);
    protected abstract String expectedTip();

    @Override
    public void verify(final VerificationData data) {
        int actualSize = data.matchedSize();
        if (!meet(actualSize)) {
            throw new VerificationException(data.mismatchDescription(actualSize, expectedTip()));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy