### Question:
HttpRequestHandler extends SimpleChannelUpstreamHandler { protected HttpResponse handleDeleteScope(HttpRequest req) { HttpResponse response = null; Matcher m = OAUTH_CLIENT_SCOPE_PATTERN.matcher(req.getUri()); if (m.find()) { String scopeName = m.group(1); ScopeService scopeService = getScopeService(); try { String responseMsg = scopeService.deleteScope(scopeName); response = Response.createOkResponse(responseMsg); } catch (OAuthException e) { invokeExceptionHandler(e, req); response = Response.createResponse(e.getHttpStatus(), e.getMessage()); } } else { response = Response.createNotFoundResponse(); } return response; }  @Override void messageReceived(ChannelHandlerContext ctx, MessageEvent e);  }### Answer:
@Test public void when_uri_does_not_match_OAUTH_SCOPE_DELETE_PATTERN_return_not_found() throws Exception { HttpRequest req = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.DELETE, HttpRequestHandler.APPLICATION_URI); req.setUri(HttpRequestHandler.OAUTH_CLIENT_SCOPE_URI + "/non@ValidScope"); HttpResponse response = handler.handleDeleteScope(req); assertEquals(response.getStatus(), HttpResponseStatus.NOT_FOUND); }