use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertConditionOnRegistry.
protected void assertConditionOnRegistry(TestDeploymentListener listener, Function<DefaultRegistry, Boolean> verifier) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
prober.check(new JUnitProbe() {
@Override
public boolean test() {
DefaultRegistry registry = (DefaultRegistry) listener.getRegistry();
if (registry == null) {
return false;
}
return verifier.apply(registry);
}
@Override
public String describeFailure() {
return "Properties were not overriden by the deployment properties";
}
});
}
use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertAtLeastOneUndeploymentSuccess.
protected void assertAtLeastOneUndeploymentSuccess(final DeploymentListener listener, final String appName) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
prober.check(new JUnitProbe() {
@Override
public boolean test() {
verify(listener, atLeastOnce()).onUndeploymentSuccess(appName);
return true;
}
@Override
public String describeFailure() {
return "Failed to undeploy artifact: " + appName + System.lineSeparator() + super.describeFailure();
}
});
}
use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertDeploymentFailure.
protected void assertDeploymentFailure(final DeploymentListener listener, final String artifactName, final VerificationMode mode) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
prober.check(new JUnitProbe() {
@Override
public boolean test() {
verify(listener, mode).onDeploymentFailure(eq(artifactName), any(Throwable.class));
return true;
}
@Override
public String describeFailure() {
return getArtifactType(listener) + " deployment was supposed to fail for: " + artifactName + super.describeFailure();
}
});
}
use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertUndeploymentSuccess.
protected void assertUndeploymentSuccess(final DeploymentListener listener, final String appName) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
prober.check(new JUnitProbe() {
@Override
public boolean test() {
verify(listener, times(1)).onUndeploymentSuccess(appName);
return true;
}
@Override
public String describeFailure() {
return "Failed to undeploy artifact: " + appName + System.lineSeparator() + super.describeFailure();
}
});
}
use of org.mule.tck.probe.JUnitProbe in project mule by mulesoft.
the class AbstractDeploymentTestCase method assertRedeploymentStart.
protected void assertRedeploymentStart(final DeploymentListener listener, final String artifactName) {
Prober prober = new PollingProber(DEPLOYMENT_TIMEOUT, 100);
prober.check(new JUnitProbe() {
@Override
public boolean test() {
verify(listener).onRedeploymentStart(eq(artifactName));
return true;
}
@Override
public String describeFailure() {
return getArtifactType(listener) + " redeployment was supposed to start for: " + artifactName + super.describeFailure();
}
});
}
Aggregations