From 401c9ee4be8e2db4e01519ea8af3ced0795cf536 Mon Sep 17 00:00:00 2001 From: Gerviba <gerviba@gerviba.hu> Date: Mon, 19 Feb 2018 02:09:05 +0100 Subject: [PATCH] Add license, fix readme --- README.md | 6 ++++-- .../gerviba/authsch/response/AuthResponse.java | 3 +++ .../hu/gerviba/authsch/struct/BMEUnitScope.java | 3 +++ .../java/hu/gerviba/authsch/struct/Entrant.java | 3 +++ .../authsch/struct/PersonEntitlement.java | 3 +++ .../hu/gerviba/authsch/AuthResponseTest.java | 9 +++++++++ .../java/hu/gerviba/authsch/AuthSchAPITest.java | 9 +++++++++ .../hu/gerviba/authsch/ProfileResponseTest.java | 17 +++++++++++++---- .../hu/gerviba/authsch/struct/ScopeTest.java | 11 ++++++++++- 9 files changed, 57 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3b0f6e6..f7bd5f1 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,12 @@ AuthSch Java API <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> - <version>2.8.0</version> + <version>2.8.2</version> </dependency> ``` +If you're using a web container, you might need to put a [gson-2.8.2.jar](https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.2/) into the `WEB_INF/lib` folder. + ### Initialize ```java @@ -69,7 +71,7 @@ TODO ## License -** "THE BEER-WARE LICENSE" (Revision 42): ** <br> + "THE BEER-WARE LICENSE" (Revision 42): <br> <br> <gerviba@gerviba.hu> wrote this file. As long as you retain this notice you <br> can do whatever you want with this stuff. If we meet some day, and you think <br> diff --git a/src/main/java/hu/gerviba/authsch/response/AuthResponse.java b/src/main/java/hu/gerviba/authsch/response/AuthResponse.java index f84aa2d..2db1675 100644 --- a/src/main/java/hu/gerviba/authsch/response/AuthResponse.java +++ b/src/main/java/hu/gerviba/authsch/response/AuthResponse.java @@ -14,6 +14,9 @@ import java.util.List; import hu.gerviba.authsch.struct.Scope; +/** + * @author Gerviba + */ public final class AuthResponse implements Serializable { private static final long serialVersionUID = 4140354200501250401L; diff --git a/src/main/java/hu/gerviba/authsch/struct/BMEUnitScope.java b/src/main/java/hu/gerviba/authsch/struct/BMEUnitScope.java index 3c81c34..a204644 100644 --- a/src/main/java/hu/gerviba/authsch/struct/BMEUnitScope.java +++ b/src/main/java/hu/gerviba/authsch/struct/BMEUnitScope.java @@ -9,6 +9,9 @@ */ package hu.gerviba.authsch.struct; +/** + * @author Gerviba + */ public enum BMEUnitScope { BME(true, false, false, false), BME_VIK(true, true, false, false), diff --git a/src/main/java/hu/gerviba/authsch/struct/Entrant.java b/src/main/java/hu/gerviba/authsch/struct/Entrant.java index 55cb8d5..134ca88 100644 --- a/src/main/java/hu/gerviba/authsch/struct/Entrant.java +++ b/src/main/java/hu/gerviba/authsch/struct/Entrant.java @@ -11,6 +11,9 @@ package hu.gerviba.authsch.struct; import java.io.Serializable; +/** + * @author Gerviba + */ public class Entrant implements Serializable { private static final long serialVersionUID = 461763126385555164L; diff --git a/src/main/java/hu/gerviba/authsch/struct/PersonEntitlement.java b/src/main/java/hu/gerviba/authsch/struct/PersonEntitlement.java index fd6439b..4c5e4af 100644 --- a/src/main/java/hu/gerviba/authsch/struct/PersonEntitlement.java +++ b/src/main/java/hu/gerviba/authsch/struct/PersonEntitlement.java @@ -11,6 +11,9 @@ package hu.gerviba.authsch.struct; import java.io.Serializable; +/** + * @author Gerviba + */ public class PersonEntitlement implements Serializable { private static final long serialVersionUID = -2904767686389619156L; diff --git a/src/test/java/hu/gerviba/authsch/AuthResponseTest.java b/src/test/java/hu/gerviba/authsch/AuthResponseTest.java index 6345149..3044d43 100644 --- a/src/test/java/hu/gerviba/authsch/AuthResponseTest.java +++ b/src/test/java/hu/gerviba/authsch/AuthResponseTest.java @@ -1,5 +1,14 @@ package hu.gerviba.authsch; +/** + * + * "THE BEER-WARE LICENSE" (Revision 42): + * + * <gerviba@gerviba.hu> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Szabó Gergely + * + */ import static org.junit.Assert.*; import java.util.Arrays; diff --git a/src/test/java/hu/gerviba/authsch/AuthSchAPITest.java b/src/test/java/hu/gerviba/authsch/AuthSchAPITest.java index af72942..9a0bb28 100644 --- a/src/test/java/hu/gerviba/authsch/AuthSchAPITest.java +++ b/src/test/java/hu/gerviba/authsch/AuthSchAPITest.java @@ -1,3 +1,12 @@ +/** + * + * "THE BEER-WARE LICENSE" (Revision 42): + * + * <gerviba@gerviba.hu> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Szabó Gergely + * + */ package hu.gerviba.authsch; import static org.junit.Assert.*; diff --git a/src/test/java/hu/gerviba/authsch/ProfileResponseTest.java b/src/test/java/hu/gerviba/authsch/ProfileResponseTest.java index 8ba20a8..2f7d619 100644 --- a/src/test/java/hu/gerviba/authsch/ProfileResponseTest.java +++ b/src/test/java/hu/gerviba/authsch/ProfileResponseTest.java @@ -1,3 +1,12 @@ +/** + * + * "THE BEER-WARE LICENSE" (Revision 42): + * + * <gerviba@gerviba.hu> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Szabó Gergely + * + */ package hu.gerviba.authsch; import static org.junit.Assert.assertEquals; @@ -55,10 +64,10 @@ public class ProfileResponseTest { assertEquals("KB", profile.getEntrants().get(0).getEntrantType()); assertEquals(Arrays.asList("BMEGT42A001", "BMEGT52A001", "BMEGT70BS2B"), profile.getCourses()); - assertEquals(Arrays.asList("junit@sch.hu", "juint@balu.sch.bme.hu", "LinuxTerminal", "CERTSVC_DCOM_ACCESS", "Users"), - profile.getADMemberships()); - assertEquals(Arrays.asList(BMEUnitScope.BME, BMEUnitScope.BME_ACTIVE, BMEUnitScope.BME_VIK, BMEUnitScope.BME_VIK_ACTIVE), - profile.getBmeUnitScopes()); + assertEquals(Arrays.asList("junit@sch.hu", "juint@balu.sch.bme.hu", "LinuxTerminal", + "CERTSVC_DCOM_ACCESS", "Users"), profile.getADMemberships()); + assertEquals(Arrays.asList(BMEUnitScope.BME, BMEUnitScope.BME_ACTIVE, BMEUnitScope.BME_VIK, + BMEUnitScope.BME_VIK_ACTIVE), profile.getBmeUnitScopes()); } @Test diff --git a/src/test/java/hu/gerviba/authsch/struct/ScopeTest.java b/src/test/java/hu/gerviba/authsch/struct/ScopeTest.java index de5a98b..095ceee 100644 --- a/src/test/java/hu/gerviba/authsch/struct/ScopeTest.java +++ b/src/test/java/hu/gerviba/authsch/struct/ScopeTest.java @@ -1,3 +1,12 @@ +/** + * + * "THE BEER-WARE LICENSE" (Revision 42): + * + * <gerviba@gerviba.hu> wrote this file. As long as you retain this notice you + * can do whatever you want with this stuff. If we meet some day, and you think + * this stuff is worth it, you can buy me a beer in return. Szabó Gergely + * + */ package hu.gerviba.authsch.struct; import static org.junit.Assert.*; @@ -32,7 +41,7 @@ public class ScopeTest { @Test public void testListFromString() throws Exception { - assertEquals(Arrays.asList(Scope.BASIC, Scope.GIVEN_NAME, Scope.ACTIVE_DIRECTORY_MEMBERSHIP), + assertEquals(Arrays.asList(Scope.BASIC, Scope.GIVEN_NAME, Scope.ACTIVE_DIRECTORY_MEMBERSHIP), Scope.listFromString(" ", "basic givenName admembership")); } -- GitLab