package util;

import org.junit.jupiter.api.Test;
import org.skyve.domain.Bean;
import org.skyve.domain.messages.ValidationException;
import org.skyve.metadata.controller.ServerSideAction;

public abstract class AbstractActionTest<T extends Bean, A extends ServerSideAction<T>> extends AbstractH2TestForJUnit5 {

	protected abstract A getAction();

	protected abstract T getBean() throws Exception;

	@Test
	public void testExecute() throws Exception {
		try {
			getAction().execute(getBean(), null);
		} catch (ValidationException e) {
			// test pass - action validated incorrect input
		}
	}
}

@@ -127,16 +127,64 @@
 eption;%0A
+import org.skyve.impl.sail.mock.MockWebContext;%0A
 import o
@@ -541,11 +541,27 @@
 ), n
-ull
+ew MockWebContext()
 );%0A%09

Update AbstractActionTest to use the MockWebContext to avoid exceptions in tests when actions use a webContext