TrackHelper { public Outlink outlink(URL url) { return new Outlink(this, url); } private  TrackHelper(); private  TrackHelper(@Nullable TrackMe baseTrackMe); static TrackHelper track(); static TrackHelper track(@Nullable TrackMe base); Screen screen(String path); Screen screen(Activity activity); EventBuilder event(String category, String action); Goal goal(int idGoal); Outlink outlink(URL url); Search search(String keyword); Download download(DownloadTracker downloadTracker); Download download(); ContentImpression impression(String contentName); ContentInteraction interaction(String contentName, String contentInteraction); CartUpdate cartUpdate(int grandTotal); Order order(String orderId, int grandTotal); Exception exception(Throwable throwable); UncaughtExceptions uncaughtExceptions(); @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) AppTracking screens(Application app); Dimension dimension(int id, String value); @Deprecated VisitVariables visitVariables(int id, String name, String value); @Deprecated VisitVariables visitVariables(CustomVariables customVariables);  }
@Test public void testOutlink() throws Exception { URL valid = new URL("https: track().outlink(valid).with(mTracker); verify(mTracker).track(mCaptor.capture()); assertEquals(valid.toExternalForm(), mCaptor.getValue().get(QueryParams.LINK)); assertEquals(valid.toExternalForm(), mCaptor.getValue().get(QueryParams.URL_PATH)); valid = new URL("https: track().outlink(valid).with(mTracker); verify(mTracker, times(2)).track(mCaptor.capture()); assertEquals(valid.toExternalForm(), mCaptor.getValue().get(QueryParams.LINK)); assertEquals(valid.toExternalForm(), mCaptor.getValue().get(QueryParams.URL_PATH)); valid = new URL("ftp: track().outlink(valid).with(mTracker); verify(mTracker, times(3)).track(mCaptor.capture()); assertEquals(valid.toExternalForm(), mCaptor.getValue().get(QueryParams.LINK)); assertEquals(valid.toExternalForm(), mCaptor.getValue().get(QueryParams.URL_PATH)); }