### Question:
AppFallbackHandler extends AbstractBounceHandler { @Override public FullHttpResponse respond(FullHttpRequest req, ChannelHandlerContext ctx) throws Exception { String path = new QueryStringDecoder(req.getUri()).path(); if(path.startsWith("/ios/")) { return redirect(appleStoreUrl); } if(path.startsWith("/android/")) { RequestInfo info = parseUrl(req, ""); if(!StringUtils.isEmpty(info.getToken()) && androidStoreUrl.contains("<token>")) return redirect(androidStoreUrl.replace("<token>", info.getToken())); else return redirect(androidStoreUrl); } return redirect(helpUrl); } @Inject  AppFallbackHandler(
			AlwaysAllow authorizer, 
			BridgeMetrics metrics,
			BounceConfig config
	); @Override boolean matches(FullHttpRequest req); @Override FullHttpResponse respond(FullHttpRequest req, ChannelHandlerContext ctx);  }### Answer:
@Test public void testIOsRedirect() throws Exception { FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/ios/run"); replay(); FullHttpResponse response = handler.respond(request, mockContext()); assertRedirectTo(response, config.getAppleStoreUrl()); }
@Test public void testAndroidRedirect() throws Exception { FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/android/run"); replay(); FullHttpResponse response = handler.respond(request, mockContext()); assertRedirectTo(response, config.getAndroidStoreUrl()); }
@Test public void testOtherRedirect() throws Exception { FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/other/run"); replay(); FullHttpResponse response = handler.respond(request, mockContext()); assertRedirectTo(response, config.getHelpUrl()); }
@Test public void testRandomRedirect() throws Exception { FullHttpRequest request = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/windows/run"); replay(); FullHttpResponse response = handler.respond(request, mockContext()); assertRedirectTo(response, config.getHelpUrl()); }