FormActionTypeSettingsDataSourceServlet extends SlingSafeMethodsServlet { @Override protected void doGet(@NotNull SlingHttpServletRequest request, @NotNull SlingHttpServletResponse response) throws ServletException, IOException { SimpleDataSource actionTypeSettingsDataSource = new SimpleDataSource(getSettingsDialogs( request.getResourceResolver()).iterator()); request.setAttribute(DataSource.class.getName(), actionTypeSettingsDataSource); }   final static String RESOURCE_TYPE; }
@Test public void testDataSource() throws Exception { context.currentResource("/apps/actiontypesettingsdatasource"); FormActionTypeSettingsDataSourceServlet dataSourceServlet = new FormActionTypeSettingsDataSourceServlet(); dataSourceServlet.doGet(context.request(), context.response()); DataSource dataSource = (DataSource) context.request().getAttribute(DataSource.class.getName()); assertNotNull(dataSource); Resource resource = dataSource.iterator().next(); assertEquals(resource.getPath(), context.currentResource("/apps/form/action/cq:dialog").getPath()); }