@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 invalidObjectIdReturnsViewNotFoundException() {
        final ViewsResource viewsResource = createViewsResource(
                mock(ViewService.class),
                mock(StartPageService.class),
                mock(RecentActivityService.class),
                mock(ClusterEventBus.class),
                new ReferencedSearchFiltersHelper(),
                EMPTY_SEARCH_FILTER_VISIBILITY_CHECKER,
                EMPTY_VIEW_RESOLVERS
        );

        assertThatThrownBy(() -> viewsResource.get("invalid", SEARCH_USER))
                .isInstanceOf(NotFoundException.class);
    }