Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
43 lines (31 sloc) 1.12 KB
package io.waterworx.pushover;
import static org.mockito.Mockito.mock;
import net.pushover.client.PushoverException;
import net.pushover.client.PushoverRestClient;
import net.pushover.client.Status;
import org.junit.Before;
import org.junit.Ignore;
public class PushoverUtilsTest {
private PushoverService pushover;
private static final String API_TOKEN = "mockToken";
private static final String USER_ID = "user1";
private PushoverRestClient client;
public void setUp() throws Exception {
client = mock(PushoverRestClient.class);
pushover = new PushoverUtils(client);
public void testPushWithMessage() throws PushoverException {
Status status = mock(Status.class);
String userID = "user1";
pushover.push(API_TOKEN, userID, "Hello World");
public void testPushWithAMessageThatIsToLong() throws PushoverException {
String message = String.format("%1$"+251+ "s", " ");
pushover.push(API_TOKEN, USER_ID, message);