org.h2.jdbc.JdbcSQLException: Database is already closed when autowiring UiUtils in context sensitive test

The database exception is just a side effect of another failure which is the real cause. That is: NoSuchBeanDefinitionException: No matching bean of type [org.openmrs.ui.framework.UiUtils] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency.

Since UiUtils is not a spring bean itself, you would need a spring bean that sub classes it for such to work.