@Test public void smartcarAuth_authUrlBuilderWithSetters() { String clientId = "client123"; String redirectUri = "scclient123: String redirectUriEncoded = "scclient123%3A%2F%2Ftest"; String[] scope = {"read_odometer", "read_vin"}; String vin = "1234567890ABCDEFG"; String[] flags = {"flag:suboption", "feature3"}; String expectedUri = "https: "&client_id=" + clientId + "&redirect_uri=" + redirectUriEncoded + "&mode=live&scope=read_odometer%20read_vin" + "&approval_prompt=force&make=BMW&state=some%20state" + "&single_select=true" + "&single_select_vin=" + vin + "&flags=flag%3Asuboption%20feature3"; SmartcarAuth smartcarAuth = new SmartcarAuth(clientId, redirectUri, scope, null); String requestUri = smartcarAuth.authUrlBuilder() .setForcePrompt(true) .setMakeBypass("BMW") .setState("some state") .setSingleSelect(true) .setSingleSelectVin(vin) .setFlags(flags) .build(); assertEquals(expectedUri, requestUri); }
public AuthUrlBuilder authUrlBuilder() { return new AuthUrlBuilder(); }
SmartcarAuth { public AuthUrlBuilder authUrlBuilder() { return new AuthUrlBuilder(); } }
SmartcarAuth { public AuthUrlBuilder authUrlBuilder() { return new AuthUrlBuilder(); } SmartcarAuth(String clientId, String redirectUri, String[] scope,
                        SmartcarCallback callback);  SmartcarAuth(String clientId, String redirectUri, String[] scope, boolean testMode,
                        SmartcarCallback callback); }
SmartcarAuth { public AuthUrlBuilder authUrlBuilder() { return new AuthUrlBuilder(); } SmartcarAuth(String clientId, String redirectUri, String[] scope,
                        SmartcarCallback callback);  SmartcarAuth(String clientId, String redirectUri, String[] scope, boolean testMode,
                        SmartcarCallback callback); AuthUrlBuilder authUrlBuilder(); void addClickHandler(final Context context, final View view); void addClickHandler(final Context context, final View view, final String authUrl); void launchAuthFlow(final Context context); void launchAuthFlow(final Context context, final String authUrl); }
SmartcarAuth { public AuthUrlBuilder authUrlBuilder() { return new AuthUrlBuilder(); } SmartcarAuth(String clientId, String redirectUri, String[] scope,
                        SmartcarCallback callback);  SmartcarAuth(String clientId, String redirectUri, String[] scope, boolean testMode,
                        SmartcarCallback callback); AuthUrlBuilder authUrlBuilder(); void addClickHandler(final Context context, final View view); void addClickHandler(final Context context, final View view, final String authUrl); void launchAuthFlow(final Context context); void launchAuthFlow(final Context context, final String authUrl);  }