HaloNetworkApi { @Api(1.0) @NonNull public String requestUrl(@NonNull String endpointId, @NonNull String apiCall) { return mClient.endpoints().getEndpoint(endpointId).buildUrl(apiCall); } protected  HaloNetworkApi(@NonNull HaloFramework framework, @NonNull HaloNetClient client); @Api(1.3) @NonNull static HaloNetworkApi newNetworkApi(@NonNull HaloFramework framework, @NonNull HaloConfig configuration); @Api(1.0) @NonNull HaloNetClient client(); @Api(1.1) @NonNull Context context(); @Api(1.3) HaloFramework framework(); @Api(1.0) @NonNull String requestUrl(@NonNull String endpointId, @NonNull String apiCall);  }
@Test public void thatRequestUrl(){ mNetworkApi = new HaloNetworkApi(mFramework,givenNetClient()); assertThat(mNetworkApi.requestUrl("1","get")).contains("HaloNetClientTest"); assertThat(mNetworkApi.requestUrl("1","get")).contains("get"); }
@Test public void thatRequestUrlWithoutPinningSHA(){ mNetworkApi = new HaloNetworkApi(mFramework,givenNetClientWithoutPinning()); assertThat(mNetworkApi.requestUrl("1","get")).contains("HaloNetClientTest"); assertThat(mNetworkApi.requestUrl("1","get")).contains("get"); }
@Test public void thatRequestUrlWithoutKitKatCertificate(){ mNetworkApi = new HaloNetworkApi(mFramework, givenNetClientWithoutKitKatCertificate()); assertThat(mNetworkApi.requestUrl("1", "get")).contains("HaloNetClientTest"); assertThat(mNetworkApi.requestUrl("1","get")).contains("get"); }