Skip to content

Instantly share code, notes, and snippets.

@gelias
Last active July 20, 2016 13:32
Show Gist options
  • Select an option

  • Save gelias/65a5efc89f311c50367f1949ad056138 to your computer and use it in GitHub Desktop.

Select an option

Save gelias/65a5efc89f311c50367f1949ad056138 to your computer and use it in GitHub Desktop.
package me.umov.auth;
import me.umov.auth.client.AuthenticationClient;
import me.umov.auth.client.AuthenticationClientImpl;
import me.umov.auth.client.model.LoginResponse;
import me.umov.auth.client.types.ModuleType;
public class AuthorizationTest {
@Test
public void getAccessTokenFromAuthorizationCode() {
String umovAuthUrl = "https://HOST/umovauth";
String authorizationCode = "XPT9234234234234234u9238746237462873467823468723649872364789234j23nb4vb2h34vb23f4g23v4bn3";
AuthenticationClient umovAuthClient = new AuthenticationClientImpl(umovAuthUrl, ModuleType.TASK_PLANNER);
LoginResponse loginResponse = umovAuthClient.authorizeCode(ModuleType.TASK_PLANNER, authorizationCode, "pt_BR");
assertEquals(200, loginResponse.getStatus().intValue());
assertNotNull(loginResponse.getAccessToken());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment