package org.zanata.notification;

import javax.jms.JMSException;
import javax.jms.ObjectMessage;
import javax.jms.QueueSender;
import javax.jms.QueueSession;

import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.zanata.events.LanguageTeamPermissionChangedEvent;

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

public class NotificationManagerTest {
    private NotificationManager manager;
    @Mock
    private QueueSender mailQueueSender;
    @Mock
    private QueueSession queueSession;
    @Mock
    private ObjectMessage message;

    @Before
    public void setUp() throws Exception {
        MockitoAnnotations.initMocks(this);
        manager = new NotificationManager(mailQueueSender, queueSession);
    }

    @Test
    public void onLanguageTeamChangeEvent() throws JMSException {
        LanguageTeamPermissionChangedEvent event =
                Mockito.mock(LanguageTeamPermissionChangedEvent.class);
        when(queueSession.createObjectMessage(event)).thenReturn(message);

        manager.onLanguageTeamPermissionChanged(event);

        verify(message).setObjectProperty(
                NotificationManager.MessagePropertiesKey.objectType.name(),
                event.getClass().getCanonicalName());
        verify(mailQueueSender).send(message);
    }
}

@@ -90,16 +90,50 @@
 essage;%0A
+import javax.jms.QueueConnection;%0A
 import j
@@ -695,16 +695,66 @@
 message;
+%0A    @Mock%0A    private QueueConnection connection;
 %0A%0A    @B
@@ -842,24 +842,92 @@
 ocks(this);%0A
+        JmsResourcesProducer producer = new JmsResourcesProducer();%0A
         mana
@@ -956,16 +956,38 @@
 Manager(
+connection, producer, 
 mailQueu

fix unit test