diff options
Diffstat (limited to 'eaaf-springboot-utils/src/test/java')
-rw-r--r-- | eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/utils/BasicSecurityConfigTest.java (renamed from eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/utils/BasicAuthUserTest.java) | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/utils/BasicAuthUserTest.java b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/utils/BasicSecurityConfigTest.java index 95bd5dcb..83117253 100644 --- a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/utils/BasicAuthUserTest.java +++ b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/utils/BasicSecurityConfigTest.java @@ -9,13 +9,14 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.BlockJUnit4ClassRunner; +import at.gv.egiz.eaaf.utils.springboot.security.AuthorizationConfiguration; import at.gv.egiz.eaaf.utils.springboot.security.BasicAuthUser; @RunWith(BlockJUnit4ClassRunner.class) -public class BasicAuthUserTest { +public class BasicSecurityConfigTest { @Test - public void simpleTest() { + public void userConfig() { assertFalse("username", BasicAuthUser.builder().password(rand()).role(rand()).build().isValid()); assertFalse("password", @@ -33,6 +34,16 @@ public class BasicAuthUserTest { } + @Test + public void authoriseConfig() { + + assertEquals("endpoint size", 2, + AuthorizationConfiguration.builder().role(rand()) + .endpoint(rand()).endpoint(rand()).build() + .getEndPointsArray().length); + + } + private String rand() { return RandomStringUtils.randomAlphanumeric(5); |