// Path: stickypunch-common/src/main/java/com/comandante/stickypunch/api/model/WebPushUser.java
// public class WebPushUser {
//     private Optional<String> deviceToken;
//     private Optional<String> websitePushId;
//     private Optional<String> userId;
//     private Optional<Boolean> isActive;
//     private Optional<Long> isActiveTimestamp;
// 
//     public WebPushUser(Optional<String> deviceToken,
//                        Optional<String> websitePushId,
//                        Optional<String> userId,
//                        Optional<Boolean> active,
//                        Optional<Long> isActiveTimestamp) {
//         this.deviceToken = deviceToken;
//         this.websitePushId = websitePushId;
//         this.userId = userId;
//         this.isActive = active;
//         this.isActiveTimestamp = isActiveTimestamp;
//     }
// 
//     public Optional<String> getDeviceToken() {
//         return deviceToken;
//     }
// 
//     public Optional<String> getWebsitePushId() {
//         return websitePushId;
//     }
// 
//     public Optional<String> getUserId() {
//         return userId;
//     }
// 
//     public Optional<Boolean> getActive() {
//         return isActive;
//     }
// 
//     public Optional<Long> getActiveTimestamp() {
//         return isActiveTimestamp;
//     }
// 
//     public void setActiveTimestamp(Long activeTimestamp) {
//         isActiveTimestamp = Optional.of(activeTimestamp);
//     }
// 
//     public void setDeviceToken(String deviceToken) {
//         this.deviceToken = Optional.of(deviceToken);
//     }
// 
//     public void setWebsitePushId(String websitePushId) {
//         this.websitePushId = Optional.of(websitePushId);
//     }
// 
//     public void setUserId(String userId) {
//         this.userId = Optional.of(userId);
//     }
// 
//     public void setActive(Boolean active) {
//         isActive = Optional.of(active);
//     }
// }
// 
// Path: stickypunch-common/src/main/java/com/comandante/stickypunch/api/model/WebPushUserBuilder.java
// public class WebPushUserBuilder {
//     private Optional<String> deviceToken = Optional.absent();
//     private Optional<String> websitePushId = Optional.absent();
//     private Optional<String> userId = Optional.absent();
//     private Optional<Boolean> active = Optional.absent();
//     private Optional<Long> isActiveTimestamp = Optional.absent();
// 
//     public WebPushUserBuilder setDeviceToken(String deviceToken) {
//         this.deviceToken = Optional.fromNullable(deviceToken);
//         return this;
//     }
// 
//     public WebPushUserBuilder setWebsitePushId(String websitePushId) {
//         this.websitePushId = Optional.fromNullable(websitePushId);
//         return this;
//     }
// 
//     public WebPushUserBuilder setUserId(String userId) {
//         this.userId = Optional.of(userId);
//         return this;
//     }
// 
//     public WebPushUserBuilder setActive(Boolean active) {
//         this.active = Optional.of(active);
//         return this;
//     }
// 
//     public WebPushUserBuilder setIsActiveTimestamp(Long timestamp) {
//         this.isActiveTimestamp = Optional.of(timestamp);
//         return this;
//     }
// 
//     public WebPushUser build() {
//         return new WebPushUser(deviceToken, websitePushId, userId, active, isActiveTimestamp);
//     }
// }


import com.google.common.base.Optional;
import com.comandante.stickypunch.api.model.WebPushUser;
import com.comandante.stickypunch.api.model.WebPushUserBuilder;
import org.apache.commons.configuration.BaseConfiguration;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.List;
import java.util.UUID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
                .setUserId(userId)
                .setWebsitePushId("")
                .setIsActiveTimestamp(System.currentTimeMillis()).build();

        sqLiteWebPushStore.updateWebPushUser(webPushUser);

        Optional<WebPushUser> webPushUser1 = sqLiteWebPushStore.getWebPushUsersByUserIdAndDeviceToken(userId, deviceToken);

        assertTrue(webPushUser1.isPresent());
    }

    @Test
    public void testGetAllDevices() throws Exception {

        String randomUUID = UUID.randomUUID().toString();

        WebPushUser webPushUser = new WebPushUserBuilder()
                .setActive(true)
                .setDeviceToken(UUID.randomUUID().toString())
                .setUserId(UUID.randomUUID().toString())
                .setWebsitePushId("")
                .setIsActiveTimestamp(System.currentTimeMillis()).build();

        WebPushUser webPushUser1 = new WebPushUserBuilder()
                .setActive(true)
                .setDeviceToken(UUID.randomUUID().toString())
                .setUserId(randomUUID)
                .setWebsitePushId("")
                .setIsActiveTimestamp(System.currentTimeMillis()).build();

// Path: stickypunch-common/src/main/java/com/comandante/stickypunch/api/model/WebPushUser.java
// public class WebPushUser {
//     private Optional<String> deviceToken;
//     private Optional<String> websitePushId;
//     private Optional<String> userId;
//     private Optional<Boolean> isActive;
//     private Optional<Long> isActiveTimestamp;
// 
//     public WebPushUser(Optional<String> deviceToken,
//                        Optional<String> websitePushId,
//                        Optional<String> userId,
//                        Optional<Boolean> active,
//                        Optional<Long> isActiveTimestamp) {
//         this.deviceToken = deviceToken;
//         this.websitePushId = websitePushId;
//         this.userId = userId;
//         this.isActive = active;
//         this.isActiveTimestamp = isActiveTimestamp;
//     }
// 
//     public Optional<String> getDeviceToken() {
//         return deviceToken;
//     }
// 
//     public Optional<String> getWebsitePushId() {
//         return websitePushId;
//     }
// 
//     public Optional<String> getUserId() {
//         return userId;
//     }
// 
//     public Optional<Boolean> getActive() {
//         return isActive;
//     }
// 
//     public Optional<Long> getActiveTimestamp() {
//         return isActiveTimestamp;
//     }
// 
//     public void setActiveTimestamp(Long activeTimestamp) {
//         isActiveTimestamp = Optional.of(activeTimestamp);
//     }
// 
//     public void setDeviceToken(String deviceToken) {
//         this.deviceToken = Optional.of(deviceToken);
//     }
// 
//     public void setWebsitePushId(String websitePushId) {
//         this.websitePushId = Optional.of(websitePushId);
//     }
// 
//     public void setUserId(String userId) {
//         this.userId = Optional.of(userId);
//     }
// 
//     public void setActive(Boolean active) {
//         isActive = Optional.of(active);
//     }
// }
// 
// Path: stickypunch-common/src/main/java/com/comandante/stickypunch/api/model/WebPushUserBuilder.java
// public class WebPushUserBuilder {
//     private Optional<String> deviceToken = Optional.absent();
//     private Optional<String> websitePushId = Optional.absent();
//     private Optional<String> userId = Optional.absent();
//     private Optional<Boolean> active = Optional.absent();
//     private Optional<Long> isActiveTimestamp = Optional.absent();
// 
//     public WebPushUserBuilder setDeviceToken(String deviceToken) {
//         this.deviceToken = Optional.fromNullable(deviceToken);
//         return this;
//     }
// 
//     public WebPushUserBuilder setWebsitePushId(String websitePushId) {
//         this.websitePushId = Optional.fromNullable(websitePushId);
//         return this;
//     }
// 
//     public WebPushUserBuilder setUserId(String userId) {
//         this.userId = Optional.of(userId);
//         return this;
//     }
// 
//     public WebPushUserBuilder setActive(Boolean active) {
//         this.active = Optional.of(active);
//         return this;
//     }
// 
//     public WebPushUserBuilder setIsActiveTimestamp(Long timestamp) {
//         this.isActiveTimestamp = Optional.of(timestamp);
//         return this;
//     }
// 
//     public WebPushUser build() {
//         return new WebPushUser(deviceToken, websitePushId, userId, active, isActiveTimestamp);
//     }
// }


// Path: stickypunch-storage/src/test/java/com/comandante/stickypunch/SQLiteWebPushStoreTest.java
import com.google.common.base.Optional;
import com.comandante.stickypunch.api.model.WebPushUser;
import com.comandante.stickypunch.api.model.WebPushUserBuilder;
import org.apache.commons.configuration.BaseConfiguration;
import org.junit.BeforeClass;
import org.junit.Test;
import java.util.List;
import java.util.UUID;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

                .setUserId(userId)
                .setWebsitePushId("")
                .setIsActiveTimestamp(System.currentTimeMillis()).build();

        sqLiteWebPushStore.updateWebPushUser(webPushUser);

        Optional<WebPushUser> webPushUser1 = sqLiteWebPushStore.getWebPushUsersByUserIdAndDeviceToken(userId, deviceToken);

        assertTrue(webPushUser1.isPresent());
    }

    @Test
    public void testGetAllDevices() throws Exception {

        String randomUUID = UUID.randomUUID().toString();

        WebPushUser webPushUser = new WebPushUserBuilder()
                .setActive(true)
                .setDeviceToken(UUID.randomUUID().toString())
                .setUserId(UUID.randomUUID().toString())
                .setWebsitePushId("")
                .setIsActiveTimestamp(System.currentTimeMillis()).build();

        WebPushUser webPushUser1 = new WebPushUserBuilder()
                .setActive(true)
                .setDeviceToken(UUID.randomUUID().toString())
                .setUserId(randomUUID)
                .setWebsitePushId("")
                .setIsActiveTimestamp(System.currentTimeMillis()).build();

        sqLiteWebPushStore.save(webPushUser);