ContentSelectorsApiResource implements Resource, ContentSelectorsResourceDoc { @GET @RequiresAuthentication @RequiresPermissions("nexus:selectors:read") public List<ContentSelectorApiResponse> getContentSelectors() { return selectorManager.browse().stream().map(ContentSelectorsApiResource::fromSelectorConfiguration) .collect(toList()); } @Inject  ContentSelectorsApiResource(final SelectorFactory selectorFactory, final SelectorManager selectorManager); @GET @RequiresAuthentication @RequiresPermissions("nexus:selectors:read") List<ContentSelectorApiResponse> getContentSelectors(); @POST @Validate @RequiresAuthentication @RequiresPermissions("nexus:selectors:create") void createContentSelector(@Valid final ContentSelectorApiCreateRequest request); @GET @Path("{name}") @RequiresAuthentication @RequiresPermissions("nexus:selectors:read") ContentSelectorApiResponse getContentSelector(@PathParam("name") final String name); @PUT @Path("{name}") @Validate @RequiresAuthentication @RequiresPermissions("nexus:selectors:update") void updateContentSelector(@PathParam("name") final String name,
                                    @Valid final ContentSelectorApiUpdateRequest request); @DELETE @Path("{name}") @RequiresAuthentication @RequiresPermissions("nexus:selectors:delete") void deleteContentSelector(@PathParam("name") final String name);  }
@Test public void getContentSelectorsConvertsTheResult() { SelectorConfiguration selectorConfiguration = new OrientSelectorConfiguration(); selectorConfiguration.setName("name"); selectorConfiguration.setType("csel"); selectorConfiguration.setDescription("description"); selectorConfiguration.setAttributes(singletonMap("expression", "test-expression")); when(selectorManager.browse()).thenReturn(asList(selectorConfiguration)); List<ContentSelectorApiResponse> response = underTest.getContentSelectors(); assertThat(response.get(0).getName(), is("name")); assertThat(response.get(0).getType(), is("csel")); assertThat(response.get(0).getDescription(), is("description")); assertThat(response.get(0).getExpression(), is("test-expression")); }