Search in sources :

Example 1 with EmailSubscriptionId

use of com.redhat.cloud.notifications.models.EmailSubscriptionId in project notifications-backend by RedHatInsights.

the class LifecycleITest method subscribeUserPreferences.

@Transactional
void subscribeUserPreferences(String accountId, String userId, UUID appId) {
    Application application = entityManager.find(Application.class, appId);
    EmailSubscription subscription = new EmailSubscription();
    subscription.setId(new EmailSubscriptionId());
    subscription.setAccountId(accountId);
    subscription.setUserId(userId);
    subscription.setApplication(application);
    subscription.setType(INSTANT);
    entityManager.persist(subscription);
}
Also used : EmailSubscriptionId(com.redhat.cloud.notifications.models.EmailSubscriptionId) Application(com.redhat.cloud.notifications.models.Application) EmailSubscription(com.redhat.cloud.notifications.models.EmailSubscription) Transactional(javax.transaction.Transactional)

Aggregations

Application (com.redhat.cloud.notifications.models.Application)1 EmailSubscription (com.redhat.cloud.notifications.models.EmailSubscription)1 EmailSubscriptionId (com.redhat.cloud.notifications.models.EmailSubscriptionId)1 Transactional (javax.transaction.Transactional)1