@GET
    @Path("{id}")
    @ApiOperation("Get a single view")
    public ViewDTO get(@ApiParam(name = "id") @PathParam("id") @NotEmpty String id, @Context SearchUser searchUser) {
        if ("default".equals(id)) {
            // If the user is not permitted to access the default view, return a 404
            return dbService.getDefault()
                    .filter(searchUser::canReadView)
                    .orElseThrow(() -> new NotFoundException("Default view doesn't exist"));
        }

        // Attempt to resolve the view from optional view resolvers before using the default database lookup.
        // The view resolvers must be used first, because the ID may not be a valid hex ID string.
        return resolveView(searchUser, id);
    }
@Test
    public void testViewResolver() {
        // Setup
        final String resolverName = "test-resolver";
        final Map<String, ViewResolver> viewResolvers = new HashMap<>();
        viewResolvers.put(resolverName, new TestableFixedViewResolver(TEST_DASHBOARD_VIEW));

        final ViewsResource testResource = createViewsResource(
                mock(ViewService.class),
                mock(StartPageService.class),
                mock(RecentActivityService.class),
                mock(ClusterEventBus.class),
                new ReferencedSearchFiltersHelper(),
                EMPTY_SEARCH_FILTER_VISIBILITY_CHECKER,
                viewResolvers
        );

        // Verify that view for valid id is found.
        Assertions.assertThat(testResource.get(resolverName + ViewResolverDecoder.SEPARATOR + VIEW_ID, SEARCH_USER).id()).isEqualTo(VIEW_ID);


        // Verify error paths for invalid resolver names and view ids.
        Assertions.assertThatThrownBy(() -> testResource.get("invalid-resolver-name" + ViewResolverDecoder.SEPARATOR + VIEW_ID, SEARCH_USER))
                .isInstanceOf(NotFoundException.class)
                .hasMessageContaining("Failed to find view resolver: invalid-resolver-name");

        Assertions.assertThatThrownBy(() -> testResource.get(resolverName + ViewResolverDecoder.SEPARATOR + "invalid-view-id", SEARCH_USER))
                .isInstanceOf(NotFoundException.class)
                .hasMessageContaining("Failed to resolve view:test-resolver__invalid-view-id");
    }