@Test public void sendNotFoundWhenLegacyUrlAndFormatDoesNotMatch() throws Exception { when(repository.getFormat()).thenReturn(new Format("yum") { }); when(request.getPathInfo()).thenReturn("/test-repo/content.txt"); when(request.getRequestURI()).thenReturn("/content/sites/test-repo/content.txt"); viewServlet.doService(request, response); ArgumentCaptor<Response> responseCaptor = ArgumentCaptor.forClass(Response.class); verify(sender).send(eq(null), responseCaptor.capture(), eq(response)); assertThat(responseCaptor.getValue().getStatus().getCode(), is(equalTo(NOT_FOUND))); assertThat(responseCaptor.getValue().getStatus().getMessage(), is(equalTo(NOT_FOUND_MESSAGE))); }
@Override protected void doService(final HttpServletRequest request, final HttpServletResponse response) throws Exception { if (handleFormatSpecificUri(request, response)) { return; } super.doService(request, response); }
LegacyViewServlet extends ViewServlet { @Override protected void doService(final HttpServletRequest request, final HttpServletResponse response) throws Exception { if (handleFormatSpecificUri(request, response)) { return; } super.doService(request, response); } }
LegacyViewServlet extends ViewServlet { @Override protected void doService(final HttpServletRequest request, final HttpServletResponse response) throws Exception { if (handleFormatSpecificUri(request, response)) { return; } super.doService(request, response); } @Inject  LegacyViewServlet(final RepositoryManager repositoryManager,
                           final HttpResponseSenderSelector httpResponseSenderSelector,
                           final DescriptionHelper descriptionHelper,
                           final DescriptionRenderer descriptionRenderer,
                           final List<LegacyViewContributor> legacyViewContributors,
                           @Named("${nexus.repository.sandbox.enable:-true}") final boolean sandboxEnabled); }
LegacyViewServlet extends ViewServlet { @Override protected void doService(final HttpServletRequest request, final HttpServletResponse response) throws Exception { if (handleFormatSpecificUri(request, response)) { return; } super.doService(request, response); } @Inject  LegacyViewServlet(final RepositoryManager repositoryManager,
                           final HttpResponseSenderSelector httpResponseSenderSelector,
                           final DescriptionHelper descriptionHelper,
                           final DescriptionRenderer descriptionRenderer,
                           final List<LegacyViewContributor> legacyViewContributors,
                           @Named("${nexus.repository.sandbox.enable:-true}") final boolean sandboxEnabled);  }
LegacyViewServlet extends ViewServlet { @Override protected void doService(final HttpServletRequest request, final HttpServletResponse response) throws Exception { if (handleFormatSpecificUri(request, response)) { return; } super.doService(request, response); } @Inject  LegacyViewServlet(final RepositoryManager repositoryManager,
                           final HttpResponseSenderSelector httpResponseSenderSelector,
                           final DescriptionHelper descriptionHelper,
                           final DescriptionRenderer descriptionRenderer,
                           final List<LegacyViewContributor> legacyViewContributors,
                           @Named("${nexus.repository.sandbox.enable:-true}") final boolean sandboxEnabled);   }