Skip to content

Commit 7a7b54f

Browse files
cdbmbrianchandotcom
authored andcommitted
LPD-51524 adjust test exception and inline scopeAliasesList
1 parent 1af7783 commit 7a7b54f

File tree

1 file changed

+3
-9
lines changed
  • modules/apps/oauth2-provider/oauth2-provider-test/src/testIntegration/java/com/liferay/oauth2/provider/client/test

1 file changed

+3
-9
lines changed

modules/apps/oauth2-provider/oauth2-provider-test/src/testIntegration/java/com/liferay/oauth2/provider/client/test/ScopeFinderTest.java

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.liferay.oauth2.provider.scope.spi.scope.finder.ScopeFinder;
1313
import com.liferay.oauth2.provider.service.OAuth2ApplicationLocalService;
1414
import com.liferay.oauth2.provider.service.OAuth2ScopeGrantLocalService;
15-
import com.liferay.portal.kernel.exception.PortalException;
1615
import com.liferay.portal.kernel.model.User;
1716
import com.liferay.portal.kernel.test.rule.AggregateTestRule;
1817
import com.liferay.portal.kernel.test.util.UserTestUtil;
@@ -21,10 +20,8 @@
2120
import com.liferay.portal.test.rule.Inject;
2221
import com.liferay.portal.test.rule.LiferayIntegrationTestRule;
2322

24-
import java.util.ArrayList;
2523
import java.util.Collections;
2624
import java.util.Dictionary;
27-
import java.util.List;
2825

2926
import javax.ws.rs.client.Invocation;
3027
import javax.ws.rs.client.WebTarget;
@@ -49,7 +46,7 @@ public class ScopeFinderTest extends BaseClientTestCase {
4946
new LiferayIntegrationTestRule();
5047

5148
@Test
52-
public void testUnavailableAssignedScopeAliases() throws PortalException {
49+
public void testUnavailableAssignedScopeAliases() throws Exception {
5350
String token = getToken(
5451
"oauthTestClientCredentials", null,
5552
this::getClientCredentialsResponse, this::parseTokenString);
@@ -103,17 +100,14 @@ public void testUnavailableAssignedScopeAliases() throws PortalException {
103100
invocationBuilder.get(
104101
).getStatus());
105102

106-
List<String> scopeAliasess = new ArrayList<>();
107-
108-
scopeAliasess.add("Liferay.Captcha.REST.everything.write");
109-
110103
OAuth2Application oAuth2Application =
111104
_oAuth2ApplicationLocalService.getOAuth2Application(
112105
_oAuth2ApplicationId);
113106

114107
_oAuth2ApplicationLocalService.updateScopeAliases(
115108
oAuth2Application.getUserId(), oAuth2Application.getUserName(),
116-
_oAuth2ApplicationId, scopeAliasess);
109+
_oAuth2ApplicationId,
110+
Collections.singletonList("Liferay.Captcha.REST.everything.write"));
117111

118112
invocationBuilder = authorize(
119113
webTarget.request(),

0 commit comments

Comments
 (0)