-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(jans-auth-server): added allowSpontaneousScopes AS json config #…
…2074 (#2111) * feat(jans-auth-server): added allowSpontaneousScopes AS JSON config #2074 #2074 docs: swagger updated * test(jans-auth-server): added SpontaneousScopeServiceTest #2074 docs: no docs
- Loading branch information
Showing
7 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...th-server/server/src/test/java/io/jans/as/server/service/SpontaneousScopeServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package io.jans.as.server.service; | ||
|
||
import io.jans.as.common.model.registration.Client; | ||
import io.jans.as.model.config.StaticConfiguration; | ||
import io.jans.as.model.configuration.AppConfiguration; | ||
import org.mockito.InjectMocks; | ||
import org.mockito.Mock; | ||
import org.mockito.testng.MockitoTestNGListener; | ||
import org.slf4j.Logger; | ||
import org.testng.annotations.Listeners; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.assertFalse; | ||
|
||
/** | ||
* @author Yuriy Z | ||
*/ | ||
@Listeners(MockitoTestNGListener.class) | ||
public class SpontaneousScopeServiceTest { | ||
|
||
@InjectMocks | ||
private SpontaneousScopeService spontaneousScopeService; | ||
|
||
@Mock | ||
private Logger log; | ||
@Mock | ||
private StaticConfiguration staticConfiguration; | ||
@Mock | ||
private AppConfiguration appConfiguration; | ||
@Mock | ||
private ScopeService scopeService; | ||
|
||
@Test | ||
public void isAllowedBySpontaneousScopes_whenGlobalConfigReturnsFalse_shouldReturnFalse() { | ||
Client client = new Client(); | ||
client.getAttributes().setAllowSpontaneousScopes(true); | ||
|
||
assertFalse(spontaneousScopeService.isAllowedBySpontaneousScopes(client, "scope")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters