com.github.dreamhead.moco.verification.AbstractTimesVerification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
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()));
}
}
}