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

net.jqwik.testing.CheckReporting Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
package net.jqwik.testing;

import org.jspecify.annotations.*;
import org.mockito.*;

import net.jqwik.api.*;
import net.jqwik.api.lifecycle.*;

@NonNullApi
public abstract class CheckReporting implements AroundPropertyHook {

	Reporter reporter = Mockito.mock(Reporter.class);

	@Override
	public int aroundPropertyProximity() {
		// Outside StatisticsHook
		return -100;
	}

	@Override
	public PropertyExecutionResult aroundProperty(PropertyLifecycleContext context, PropertyExecutor property) {
		context.wrapReporter(ignore -> reporter);
		PropertyExecutionResult result = property.execute();
		check(reporter);
		return result;
	}

	public abstract void check(@NonNull Reporter mockReporter);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy