Skip to content

Commit

Permalink
#ECOAPI-790 - Atualização do endpoint getUser do User
Browse files Browse the repository at this point in the history
  • Loading branch information
ssouza committed Aug 14, 2020
1 parent b11dfbb commit 4e2b3ba
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package br.com.senior.core.authentication;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

import br.com.senior.core.BaseIT;
import br.com.senior.core.authentication.pojos.LoginMFAInput;
import br.com.senior.core.authentication.pojos.LoginOutput;
Expand All @@ -14,10 +10,14 @@
import br.com.senior.core.authentication.pojos.RefreshTokenInput;
import br.com.senior.core.authentication.pojos.RefreshTokenOutput;
import br.com.senior.core.authentication.pojos.Scope;
import br.com.senior.core.base.ServiceException;
import br.com.senior.core.user.UserClient;
import br.com.senior.core.user.pojos.GetUserInput;
import br.com.senior.core.user.pojos.GetUserOutput;
import br.com.senior.core.base.ServiceException;

import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;

/**
* Exemplos de código do {@link br.com.senior.core.authentication.AuthenticationClient AuthenticationClient}
Expand All @@ -32,7 +32,7 @@ public void testValidLogin() throws ServiceException {
}

@Test
public void testInvalidLogin() throws ServiceException {
public void testInvalidLogin() {
Assert.assertThrows(ServiceException.class, () -> login(System.getenv("SENIOR_USERNAME"), System.getenv("PASSWORD_INVALID")));
}

Expand Down Expand Up @@ -81,11 +81,10 @@ public void testRefreshTokenWithScope() throws ServiceException {

LoginOutput loginOutput = login();
String username = loginOutput.getJsonToken().getUsername();
String email = loginOutput.getJsonToken().getUsername();
String accessToken = loginOutput.getJsonToken().getAccess_token();
String refreshToken = loginOutput.getJsonToken().getRefresh_token();

GetUserInput getUserInput = new GetUserInput(username, email);
GetUserInput getUserInput = new GetUserInput(username);
GetUserOutput getUserOutput = new UserClient(accessToken).getUser(getUserInput);

RefreshTokenInput refreshTokenInput = new RefreshTokenInput(refreshToken, Scope.DESKTOP.toString());
Expand All @@ -99,11 +98,10 @@ public void testRefreshTokenWithScope() throws ServiceException {
public void testRefreshTokenScopeLess() throws ServiceException {
LoginOutput loginOutput = login();
String username = loginOutput.getJsonToken().getUsername();
String email = loginOutput.getJsonToken().getUsername();
String accessToken = loginOutput.getJsonToken().getAccess_token();
String refreshToken = loginOutput.getJsonToken().getRefresh_token();

GetUserInput getUserInput = new GetUserInput(username, email);
GetUserInput getUserInput = new GetUserInput(username);
GetUserOutput getUserOutput = new UserClient(accessToken).getUser(getUserInput);

RefreshTokenInput refreshTokenInput = new RefreshTokenInput(refreshToken);
Expand Down

0 comments on commit 4e2b3ba

Please sign in to comment.