com.noenv.wiremongo.verification.Verifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vertx-wiremongo Show documentation
Show all versions of vertx-wiremongo Show documentation
Lightweight mongo mocking for Vert.x
package com.noenv.wiremongo.verification;
import java.util.ArrayList;
import java.util.List;
/**
* In best case, there should only exist a single instance of this class.
*
* Verifications shall only test their relative order if created by same {@link Verifier}.
*/
public class Verifier {
private final List verifications = new ArrayList<>();
public Verification checkIf(String label) {
Verification verification = new Verification(label, new ArrayList<>(this.verifications));
this.verifications.add(verification);
return verification;
}
public void assertAllSucceeded() {
verifications.forEach(Verification::assertSucceed);
}
}