diff --git a/WebApp/junit/uk/ac/exeter/QuinCe/TestBase/BaseTest.java b/WebApp/junit/uk/ac/exeter/QuinCe/TestBase/BaseTest.java index 7ced602dc..caf21917b 100644 --- a/WebApp/junit/uk/ac/exeter/QuinCe/TestBase/BaseTest.java +++ b/WebApp/junit/uk/ac/exeter/QuinCe/TestBase/BaseTest.java @@ -51,9 +51,6 @@ * Additional custom migrations for specific tests can be defined using * {@code @FlywayTest locationsForMigrate = {"resources/sql/..."}}. *
- * - * @author Steve Jones - * */ @ExtendWith(SpringExtension.class) @ContextConfiguration(locations = { "/resources/context/testContext.xml" }) @@ -62,25 +59,31 @@ public class BaseTest { /** - * A global application context + * A global application context. */ @Autowired protected ApplicationContext context; /** - * A mock Servlet Context + * A mock Servlet Context. */ @Mock protected static ServletContext servletContext; + /** + * A mock Java Server Faces context. + */ @Mock protected static FacesContext facesContext; + /** + * A mock External Context. + */ @Mock protected static ExternalContext externalContext; /** - * A mock Servlet Context Event + * A mock Servlet Context Event. */ @Mock protected static ServletContextEvent servletContextEvent; @@ -139,10 +142,10 @@ public void initResourceManager() { } /** - * Get a data source linked to the H2 test database defined in the - * {@link #context}. + * Get a {@link DataSource} linked to the H2 test database defined in the + * {@link #context}, that can be used to obtain database {@link Connection}s. * - * @return A data source + * @return A {@link DataSource}. */ protected DataSource getDataSource() { return (DataSource) context.getBean("dataSourceRef"); @@ -160,12 +163,13 @@ protected Connection getConnection() throws SQLException { } /** - * Create a {@link Stream} of {@code null} and empty String values + * Create a {@link Stream} of {@code null} and empty String values. * ** Some tests need to check behaviours with empty {@link String} values. This * method provides a {@link Stream} of empty {@link String}s that can be used - * as input to a {@link ParameterizedTest}. + * as input to a {@link ParameterizedTest}, including whitespace and + * {@code null} values. *
* * @return A {@link Stream} of various empty {@link String} values. @@ -174,6 +178,12 @@ protected static Stream