Compare commits
10 Commits
b7aee61208
...
b5eeef426d
Author | SHA1 | Date | |
---|---|---|---|
b5eeef426d | |||
![]() |
1d594097d9 | ||
![]() |
19e36db4ed | ||
![]() |
f9ca3b8890 | ||
![]() |
0cbcf27da7 | ||
be619b1843 | |||
![]() |
a9286162c8 | ||
![]() |
c4a063ebda | ||
![]() |
1e3ab9eb2f | ||
![]() |
ff4bf598ba |
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
/target
|
/target
|
||||||
/*.versionsBackup
|
/*.versionsBackup
|
||||||
/bin
|
/bin
|
||||||
|
.vscode/
|
43
pom.xml
43
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.svenkubiak</groupId>
|
<groupId>de.svenkubiak</groupId>
|
||||||
<artifactId>jpushover</artifactId>
|
<artifactId>jpushover</artifactId>
|
||||||
<version>7.0.3-SNAPSHOT</version>
|
<version>7.0.4-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<java.version>11</java.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
<scm>
|
<scm>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.10.1</version>
|
<version>3.11.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>${java.version}</source>
|
<source>${java.version}</source>
|
||||||
<target>${java.version}</target>
|
<target>${java.version}</target>
|
||||||
@ -75,19 +75,6 @@
|
|||||||
</goals>
|
</goals>
|
||||||
<phase>validate</phase>
|
<phase>validate</phase>
|
||||||
</execution>
|
</execution>
|
||||||
<execution>
|
|
||||||
<id>enforce-maven</id>
|
|
||||||
<goals>
|
|
||||||
<goal>enforce</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<rules>
|
|
||||||
<requireMavenVersion>
|
|
||||||
<version>3.8.0</version>
|
|
||||||
</requireMavenVersion>
|
|
||||||
</rules>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
<execution>
|
<execution>
|
||||||
<id>enforce-ban-circular-dependencies</id>
|
<id>enforce-ban-circular-dependencies</id>
|
||||||
<goals>
|
<goals>
|
||||||
@ -105,7 +92,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>extra-enforcer-rules</artifactId>
|
<artifactId>extra-enforcer-rules</artifactId>
|
||||||
<version>1.6.2</version>
|
<version>1.7.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
@ -164,7 +151,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>versions-maven-plugin</artifactId>
|
<artifactId>versions-maven-plugin</artifactId>
|
||||||
<version>2.14.0</version>
|
<version>2.15.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@ -202,20 +189,26 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter-engine</artifactId>
|
<artifactId>junit-jupiter-engine</artifactId>
|
||||||
<version>5.9.2</version>
|
<version>5.10.0-RC1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<snapshotRepository>
|
|
||||||
<id>ossrh</id>
|
|
||||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
|
||||||
</snapshotRepository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>ossrh</id>
|
<id>source.devloop.de-damage</id>
|
||||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
<url>https://source.devloop.de/api/packages/damage/maven</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>source.devloop.de-damage</id>
|
||||||
|
<url>https://source.devloop.de/api/packages/damage/maven</url>
|
||||||
|
</snapshotRepository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>source.devloop.de-damage</id>
|
||||||
|
<url>https://source.devloop.de/api/packages/damage/maven</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>release-sign-artifacts</id>
|
<id>release-sign-artifacts</id>
|
||||||
|
@ -224,6 +224,19 @@ public class Message implements API {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a ttl to the Pushover message
|
||||||
|
*
|
||||||
|
* @param ttl Seconds until this message should be automatically removed from the device. Needs to be positive
|
||||||
|
* @return Message instance
|
||||||
|
*/
|
||||||
|
public Message withTTL(int ttl) {
|
||||||
|
Validate.checkArgument(ttl > 0, "TTL must be a positive value");
|
||||||
|
|
||||||
|
body.put(Param.TTL.toString(), String.valueOf(ttl));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses a given proxy for the HTTP requests to Pushover
|
* Uses a given proxy for the HTTP requests to Pushover
|
||||||
*
|
*
|
||||||
|
@ -24,7 +24,8 @@ public enum Param {
|
|||||||
TOKEN("token"),
|
TOKEN("token"),
|
||||||
URL("url"),
|
URL("url"),
|
||||||
URL_TITLE("url_title"),
|
URL_TITLE("url_title"),
|
||||||
USER("user");
|
USER("user"),
|
||||||
|
TTL("ttl");
|
||||||
|
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|
||||||
|
@ -58,6 +58,18 @@ public class MessageTests {
|
|||||||
assertTrue(message.getValue(Param.USER.toString()).equals(value));
|
assertTrue(message.getValue(Param.USER.toString()).equals(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testWithTTL() {
|
||||||
|
//given
|
||||||
|
int ttl = 5;
|
||||||
|
|
||||||
|
//when
|
||||||
|
Message message = JPushover.messageAPI().withTTL(5);
|
||||||
|
|
||||||
|
//then
|
||||||
|
assertTrue(message.getValue(Param.TTL.toString()).equals(String.valueOf(ttl)));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testWithRetry() {
|
void testWithRetry() {
|
||||||
//given
|
//given
|
||||||
|
Loading…
x
Reference in New Issue
Block a user