diff --git a/pom.xml b/pom.xml index 3fd98b2..c3a8c9b 100644 --- a/pom.xml +++ b/pom.xml @@ -119,6 +119,12 @@ logback-core ${logback.version} + + junit + junit + 4.12 + test + org.slf4j slf4j-api diff --git a/src/main/java/de/svenkubiak/jpushover/JPushover.java b/src/main/java/de/svenkubiak/jpushover/JPushover.java index fa91918..20cfaf2 100644 --- a/src/main/java/de/svenkubiak/jpushover/JPushover.java +++ b/src/main/java/de/svenkubiak/jpushover/JPushover.java @@ -295,4 +295,56 @@ public class JPushover { return (jPushoverResponse == null) ? new JPushoverResponse().isSuccessful(false) : jPushoverResponse; } + + public String getToken() { + return pushoverToken; + } + + public String getUser() { + return pushoverUser; + } + + public String getMessage() { + return pushoverMessage; + } + + public String getDevice() { + return pushoverDevice; + } + + public String getTitle() { + return pushoverTitle; + } + + public String getUrl() { + return pushoverUrl; + } + + public String getUrlTitle() { + return pushoverUrlTitle; + } + + public String getTimestamp() { + return pushoverTimestamp; + } + + public String getRetry() { + return pushoverRetry; + } + + public String getExpire() { + return pushoverExpire; + } + + public String getCallback() { + return pushoverCallback; + } + + public Priority getPriority() { + return pushoverPriority; + } + + public Sound getSound() { + return pushoverSound; + } } \ No newline at end of file diff --git a/src/test/java/de/svenkubiak/jpushover/TestJPushover.java b/src/test/java/de/svenkubiak/jpushover/TestJPushover.java new file mode 100644 index 0000000..d1ffc17 --- /dev/null +++ b/src/test/java/de/svenkubiak/jpushover/TestJPushover.java @@ -0,0 +1,66 @@ +package de.svenkubiak.jpushover; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import de.svenkubiak.jpushover.enums.Priority; +import de.svenkubiak.jpushover.enums.Sound; + +public class TestJPushover { + private static final String USER = "user"; + private static final String URL_TITLE = "urlTitle"; + private static final String URL = "url"; + private static final String TOKEN = "token"; + private static final String TITLE = "title"; + private static final String TIMESTAMP = "timestamp"; + private static final String RETRY = "retry"; + private static final String MESSAGE = "message"; + private static final String EXPIRE = "expire"; + private static final String DEVICE = "device"; + private static final String CALLBACK = "callback"; + + @Test + public void TestValues(){ + JPushover push = new JPushover(); + + push.callback(CALLBACK); + assertEquals(push.getCallback(), CALLBACK); + + push.device(DEVICE); + assertEquals(push.getDevice(), DEVICE); + + push.expire(EXPIRE); + assertEquals(push.getExpire(), EXPIRE); + + push.message(MESSAGE); + assertEquals(push.getMessage(), MESSAGE); + + push.priority(Priority.HIGH); + assertEquals(push.getPriority(), Priority.HIGH); + + push.retry(RETRY); + assertEquals(push.getRetry(), RETRY); + + push.sound(Sound.ALIEN); + assertEquals(push.getSound(), Sound.ALIEN); + + push.timestamp(TIMESTAMP); + assertEquals(push.getTimestamp(), TIMESTAMP); + + push.title(TITLE); + assertEquals(push.getTitle(), TITLE); + + push.token(TOKEN); + assertEquals(push.getToken(), TOKEN); + + push.url(URL); + assertEquals(push.getUrl(), URL); + + push.urlTitle(URL_TITLE); + assertEquals(push.getUrlTitle(), URL_TITLE); + + push.user(USER); + assertEquals(push.getUser(), USER); + } +} \ No newline at end of file