package com.atlassian.stash.internal.notification.batch.dao;

import java.util.Date;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class UserNotificationBuilder {

    private final UserNotification notification = mock(UserNotification.class);

    public UserNotificationBuilder id(long id) {
        when(notification.getId()).thenReturn(id);
        return this;
    }

    public UserNotificationBuilder userId(int userId) {
        when(notification.getUserId()).thenReturn(userId);
        return this;
    }

    public UserNotificationBuilder timestamp(long timestamp) {
        when(notification.getTimestamp()).thenReturn(new Date(timestamp));
        return this;
    }

    public UserNotificationBuilder batchSenderId(String batchSenderId) {
        when(notification.getBatchSenderId()).thenReturn(batchSenderId);
        return this;
    }

    public UserNotificationBuilder batchId(String batchId) {
        when(notification.getBatchId()).thenReturn(batchId);
        return this;
    }

    public UserNotificationBuilder data(String data) {
        when(notification.getData()).thenReturn(data);
        return this;
    }

    public UserNotification build() {
        return notification;
    }

}
