BTB-35 automatisch Modulzuordnung im Kontaktstammdatemodul erhalten
diff --git a/db/oracle/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql b/db/oracle/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql
index bc6fc20..bd1f3a8 100644
--- a/db/oracle/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql
+++ b/db/oracle/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql
@@ -1 +1,52 @@
 ALTER TABLE TBL_NOTIFICATION add "RESPONSIBILITY_FORWARDING_UUID" RAW(16);
+
+CREATE OR REPLACE VIEW VIEW_ACTIVE_NOTIFICATION AS
+ SELECT S."ID",
+    S."INCIDENT_ID",
+    S."VERSION",
+    S."FK_REF_BRANCH",
+    S."FK_REF_NOTIFICATION_PRIORITY",
+    S."NOTIFICATION_TEXT",
+    S."FREE_TEXT",
+    S."FREE_TEXT_EXTENDED",
+    S."FK_REF_NOTIFICATION_STATUS",
+    S."RESPONSIBILITY_FORWARDING",
+    S."RESPONSIBILITY_FORWARDING_UUID",
+    S."REMINDER_DATE",
+    S."EXPECTED_FINISHED_DATE",
+    S."RESPONSIBILITY_CONTROL_POINT",
+    S."BEGIN_DATE",
+    S."FINISHED_DATE",
+    S."CREATE_USER",
+    S."CREATE_DATE",
+    S."MOD_USER",
+    S."MOD_DATE",
+    S."FK_REF_GRID_TERRITORY",
+    S."ADMIN_FLAG",
+    S."TYPE"
+   FROM ( SELECT TBL_NOTIFICATION."ID",
+            TBL_NOTIFICATION."INCIDENT_ID",
+            TBL_NOTIFICATION."VERSION",
+            TBL_NOTIFICATION."FK_REF_BRANCH",
+            TBL_NOTIFICATION."FK_REF_NOTIFICATION_PRIORITY",
+            TBL_NOTIFICATION."NOTIFICATION_TEXT",
+            TBL_NOTIFICATION."FREE_TEXT",
+            TBL_NOTIFICATION."FREE_TEXT_EXTENDED",
+            TBL_NOTIFICATION."FK_REF_NOTIFICATION_STATUS",
+            TBL_NOTIFICATION."RESPONSIBILITY_FORWARDING",
+            TBL_NOTIFICATION."RESPONSIBILITY_FORWARDING_UUID",
+            TBL_NOTIFICATION."REMINDER_DATE",
+            TBL_NOTIFICATION."EXPECTED_FINISHED_DATE",
+            TBL_NOTIFICATION."RESPONSIBILITY_CONTROL_POINT",
+            TBL_NOTIFICATION."BEGIN_DATE",
+            TBL_NOTIFICATION."FINISHED_DATE",
+            TBL_NOTIFICATION."CREATE_USER",
+            TBL_NOTIFICATION."CREATE_DATE",
+            TBL_NOTIFICATION."MOD_USER",
+            TBL_NOTIFICATION."MOD_DATE",
+            TBL_NOTIFICATION."FK_REF_GRID_TERRITORY",
+            TBL_NOTIFICATION."ADMIN_FLAG",
+            TBL_NOTIFICATION."TYPE",
+            RANK() OVER (PARTITION BY TBL_NOTIFICATION."INCIDENT_ID" ORDER BY "TBL_NOTIFICATION"."VERSION" DESC) AS RANK
+           FROM TBL_NOTIFICATION) S
+  WHERE S.RANK = 1;
diff --git a/db/postgreSQL/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql b/db/postgreSQL/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql
index b2db146..3dfcac4 100644
--- a/db/postgreSQL/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql
+++ b/db/postgreSQL/UpdateTo2.0.0FromDB_1.0.0/01_migrate_from_2.0.0_to_2.0.1.sql
@@ -1,2 +1,57 @@
 ALTER TABLE tbl_notification add responsibility_forwarding_uuid uuid;
 
+DROP VIEW public.VIEW_ACTIVE_NOTIFICATION;
+CREATE VIEW public.VIEW_ACTIVE_NOTIFICATION AS
+ SELECT s.id,
+    s.incident_id,
+    s.version,
+    s.fk_ref_branch,
+    s.fk_ref_notification_priority,
+    s.notification_text,
+    s.free_text,
+    s.free_text_extended,
+    s.fk_ref_notification_status,
+    s.responsibility_forwarding,
+    s.responsibility_forwarding_uuid,
+    s.reminder_date,
+    s.expected_finished_date,
+    s.responsibility_control_point,
+    s.begin_date,
+    s.finished_date,
+    s.create_user,
+    s.create_date,
+    s.mod_user,
+    s.mod_date,
+    s.fk_ref_grid_territory,
+    s.admin_flag,
+    s.type
+   FROM ( SELECT tbl_notification.id,
+            tbl_notification.incident_id,
+            tbl_notification.version,
+            tbl_notification.fk_ref_branch,
+            tbl_notification.fk_ref_notification_priority,
+            tbl_notification.notification_text,
+            tbl_notification.free_text,
+            tbl_notification.free_text_extended,
+            tbl_notification.fk_ref_notification_status,
+            tbl_notification.responsibility_forwarding,
+            tbl_notification.responsibility_forwarding_uuid,
+            tbl_notification.reminder_date,
+            tbl_notification.expected_finished_date,
+            tbl_notification.responsibility_control_point,
+            tbl_notification.begin_date,
+            tbl_notification.finished_date,
+            tbl_notification.create_user,
+            tbl_notification.create_date,
+            tbl_notification.mod_user,
+            tbl_notification.mod_date,
+            tbl_notification.fk_ref_grid_territory,
+            tbl_notification.admin_flag,
+            tbl_notification.type,
+            rank() OVER (PARTITION BY tbl_notification.incident_id ORDER BY tbl_notification.version DESC) AS rank
+           FROM TBL_NOTIFICATION) s
+  WHERE s.rank = 1;
+
+ALTER TABLE public.VIEW_ACTIVE_NOTIFICATION
+  OWNER TO btbservice;
+GRANT ALL ON TABLE public.VIEW_ACTIVE_NOTIFICATION TO btbservice;
\ No newline at end of file
diff --git a/src/main/java/org/eclipse/openk/elogbook/common/BackendConfig.java b/src/main/java/org/eclipse/openk/elogbook/common/BackendConfig.java
index 78a05da..30b10be 100644
--- a/src/main/java/org/eclipse/openk/elogbook/common/BackendConfig.java
+++ b/src/main/java/org/eclipse/openk/elogbook/common/BackendConfig.java
@@ -18,6 +18,7 @@
   private static String configFileName = "backendConfigDevLocal.json";
   private String portalBaseURL;
   private String contactBaseDataApiUrl;
+  private String elogbookModuleName;
 
   private int fileRowToRead;
   private String importFilesFolderPath;
@@ -149,6 +150,10 @@
   public String getContactServiceTechUserPwd() {
     return contactServiceTechUserPwd;
   }
+
+  public String getElogbookModuleName() {
+    return elogbookModuleName;
+  }
 }
 
 
diff --git a/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerNotification.java b/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerNotification.java
index c80e5fe..40b46cb 100644
--- a/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerNotification.java
+++ b/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerNotification.java
@@ -13,6 +13,7 @@
 package org.eclipse.openk.elogbook.controller;
 
 import org.apache.log4j.Logger;
+import org.eclipse.openk.elogbook.common.BackendConfig;
 import org.eclipse.openk.elogbook.common.JsonGeneratorBase;
 import org.eclipse.openk.elogbook.common.NotificationStatus;
 import org.eclipse.openk.elogbook.common.mapper.NotificationMapper;
@@ -35,12 +36,14 @@
 import org.eclipse.openk.elogbook.viewmodel.Notification;
 import org.eclipse.openk.elogbook.viewmodel.NotificationSearchFilter;
 import org.eclipse.openk.elogbook.viewmodel.ReminderSearchFilter;
+import org.eclipse.openk.elogbook.viewmodel.contactbasedata.AssignmentModulContactDto;
 
 import javax.persistence.EntityManager;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.UUID;
 
 public class BackendControllerNotification {
 
@@ -132,7 +135,7 @@
 
 
 
-	public Notification createNotification(Notification newNotification, String modUser) throws BtbException {
+	public Notification createNotification(Notification newNotification, String modUser, String token) throws BtbException {
 		LOGGER.debug("createNotification is called");
 
 		EntityManager emOrg = EntityHelper.getEMF().createEntityManager();
@@ -146,10 +149,28 @@
 			}
 			Notification ret = storeNotificationInDB(newNotification, dao, mapper, modUser);
 			em.getTransaction().commit();
+			linkUserToModulInContactbaseData(newNotification, token);
 			return ret;
 		} finally {
 			LOGGER.debug("createNotification is finished");
 		}
+
+
+	}
+
+	private void linkUserToModulInContactbaseData(Notification newNotification, String token) throws BtbException {
+		UUID responsibilityForwardingUuid = newNotification.getResponsibilityForwardingUuid();
+		if (responsibilityForwardingUuid != null) {
+			List<AssignmentModulContactDto> modulContactDtoList = ContactBaseDataManager.getInstance().getAssignedModulsForContact(token, responsibilityForwardingUuid);
+
+			AssignmentModulContactDto assignmentModulContactDto =
+					modulContactDtoList.stream().filter(modulContactDto -> BackendConfig.getInstance().getElogbookModuleName().equals(modulContactDto.getModulName())).findFirst().orElse(null);
+
+			if (assignmentModulContactDto == null){
+				LOGGER.debug("New link with responsibilityForwardingUuid: " + responsibilityForwardingUuid + " to module: " + BackendConfig.getInstance().getElogbookModuleName());
+				ContactBaseDataManager.getInstance().postAssignedModulsForContact(token, responsibilityForwardingUuid);
+			}
+		}
 	}
 
 	/**
diff --git a/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerUser.java b/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerUser.java
index 38c675a..1e12dee 100644
--- a/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerUser.java
+++ b/src/main/java/org/eclipse/openk/elogbook/controller/BackendControllerUser.java
@@ -30,11 +30,13 @@
 import org.eclipse.openk.elogbook.persistence.model.TblUserSettings;
 import org.eclipse.openk.elogbook.viewmodel.LoginCredentials;
 import org.eclipse.openk.elogbook.viewmodel.UserAuthentication;
+import org.eclipse.openk.elogbook.viewmodel.contactbasedata.AssignmentModulContactDto;
 import org.eclipse.openk.elogbook.viewmodel.contactbasedata.ContactTupel;
 
 import javax.persistence.EntityManager;
 import java.util.List;
 import java.util.Optional;
+import java.util.UUID;
 
 public class BackendControllerUser {
 	
diff --git a/src/main/java/org/eclipse/openk/elogbook/controller/ContactBaseDataManager.java b/src/main/java/org/eclipse/openk/elogbook/controller/ContactBaseDataManager.java
index ec45f29..775f230 100644
--- a/src/main/java/org/eclipse/openk/elogbook/controller/ContactBaseDataManager.java
+++ b/src/main/java/org/eclipse/openk/elogbook/controller/ContactBaseDataManager.java
@@ -12,6 +12,7 @@
 package org.eclipse.openk.elogbook.controller;
 
 
+import com.google.gson.reflect.TypeToken;
 import org.apache.log4j.Logger;
 import org.eclipse.openk.elogbook.common.BackendConfig;
 import org.eclipse.openk.elogbook.common.JsonGeneratorBase;
@@ -20,6 +21,7 @@
 import org.eclipse.openk.elogbook.persistence.dao.AutoCloseEntityManager;
 import org.eclipse.openk.elogbook.persistence.dao.EntityHelper;
 import org.eclipse.openk.elogbook.persistence.dao.TblNotificationDao;
+import org.eclipse.openk.elogbook.viewmodel.contactbasedata.AssignmentModulContactDto;
 import org.eclipse.openk.elogbook.viewmodel.contactbasedata.ContactTupel;
 import org.eclipse.openk.elogbook.viewmodel.contactbasedata.VwDetailedContact;
 import org.eclipse.openk.elogbook.viewmodel.contactbasedata.VwDetailedContactPage;
@@ -51,6 +53,22 @@
         return vwDetailedContactPage.getContent().stream().map(this::mapFromViewObj ).collect(Collectors.toList());
     }
 
+    public List<AssignmentModulContactDto> getAssignedModulsForContact(String token, UUID contactUuid) throws BtbException {
+        RestServiceWrapper restServiceWrapper = new RestServiceWrapper(BackendConfig.getInstance().getContactBaseDataApiUrl(), false);
+        String response = restServiceWrapper.performGetRequest("contacts/"+contactUuid+"/assignments",token);
+        return JsonGeneratorBase.getGson().fromJson(response
+                , new TypeToken<List<AssignmentModulContactDto>>() {}.getType());
+    }
+
+    public void postAssignedModulsForContact(String token, UUID contactUuid) throws BtbException {
+        AssignmentModulContactDto modulContactDto = new AssignmentModulContactDto();
+        modulContactDto.setContactId(contactUuid);
+        modulContactDto.setModulName(BackendConfig.getInstance().getElogbookModuleName());
+        String data = JsonGeneratorBase.getGson().toJson(modulContactDto);
+        RestServiceWrapper restServiceWrapper = new RestServiceWrapper(BackendConfig.getInstance().getContactBaseDataApiUrl(), false);
+        restServiceWrapper.performPostRequest("contacts/"+contactUuid+"/assignments", token, data);
+    }
+
     public void synchronizeContacts(String token) {
         LOGGER.debug("synchronizeContacts is called");
         EntityManager emOrg = EntityHelper.getEMF().createEntityManager();
diff --git a/src/main/java/org/eclipse/openk/elogbook/controller/ControllerImplementations.java b/src/main/java/org/eclipse/openk/elogbook/controller/ControllerImplementations.java
index b7ba24b..ca5f643 100644
--- a/src/main/java/org/eclipse/openk/elogbook/controller/ControllerImplementations.java
+++ b/src/main/java/org/eclipse/openk/elogbook/controller/ControllerImplementations.java
@@ -438,11 +438,14 @@
 
 	public static class CreateNotification extends BackendInvokable {
 		private String notificationJson;
+		private String token;
 		private BackendControllerNotification backendControllerNotification;
 
-		public CreateNotification(String newNotification, BackendControllerNotification backendControllerNotification) {
+		public CreateNotification(String newNotification, BackendControllerNotification backendControllerNotification,
+								  String token) {
 			this.notificationJson = newNotification;
 			this.backendControllerNotification = backendControllerNotification;
+			this.token = token;
 		}
 
 		@Override
@@ -450,7 +453,7 @@
 			new InputDataValuator().checkNotification(notificationJson);
 			Notification notification = JsonGeneratorBase.getGson().fromJson(notificationJson, Notification.class);
 			Notification persistedNotification = backendControllerNotification.createNotification(notification,
-					getModUser());
+					getModUser(), token);
 			return ResponseBuilderWrapper.INSTANCE
 					.buildOKResponse(JsonGeneratorBase.getGson().toJson(persistedNotification));
 		}
diff --git a/src/main/java/org/eclipse/openk/elogbook/rest/BackendRestService.java b/src/main/java/org/eclipse/openk/elogbook/rest/BackendRestService.java
index b0b694e..e0c16b4 100644
--- a/src/main/java/org/eclipse/openk/elogbook/rest/BackendRestService.java
+++ b/src/main/java/org/eclipse/openk/elogbook/rest/BackendRestService.java
@@ -251,7 +251,7 @@
 			@HeaderParam(value = Globals.KEYCLOAK_AUTH_TAG) String token) {
 
 		return invoke(token, SecureType.NORMAL,
-				new ControllerImplementations.CreateNotification(newNotification, new BackendControllerNotification()));
+				new ControllerImplementations.CreateNotification(newNotification, new BackendControllerNotification(), token));
 	}
 
 	@POST
@@ -262,7 +262,7 @@
 			@HeaderParam(value = Globals.KEYCLOAK_AUTH_TAG) String token) {
 
 		return invoke(token, SecureType.NORMAL,
-				new ControllerImplementations.CreateNotification(aNotification, new BackendControllerNotification()));
+				new ControllerImplementations.CreateNotification(aNotification, new BackendControllerNotification(), token));
 	}
 
 	@GET
diff --git a/src/main/java/org/eclipse/openk/elogbook/viewmodel/contactbasedata/AssignmentModulContactDto.java b/src/main/java/org/eclipse/openk/elogbook/viewmodel/contactbasedata/AssignmentModulContactDto.java
new file mode 100644
index 0000000..4569a9f
--- /dev/null
+++ b/src/main/java/org/eclipse/openk/elogbook/viewmodel/contactbasedata/AssignmentModulContactDto.java
@@ -0,0 +1,100 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 Contributors to the Eclipse Foundation
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
+package org.eclipse.openk.elogbook.viewmodel.contactbasedata;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.UUID;
+
+
+public class AssignmentModulContactDto implements Serializable {
+
+    @JsonProperty("id")
+    private UUID uuid;
+
+    private UUID contactId;
+
+    private String modulName;
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+    private Date assignmentDate;
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+    private Date expiringDate;
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+    private Date deletionLockUntil;
+
+    private String assignmentNote;
+
+    public UUID getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(UUID uuid) {
+        this.uuid = uuid;
+    }
+
+    public UUID getContactId() {
+        return contactId;
+    }
+
+    public void setContactId(UUID contactId) {
+        this.contactId = contactId;
+    }
+
+    public String getModulName() {
+        return modulName;
+    }
+
+    public void setModulName(String modulName) {
+        this.modulName = modulName;
+    }
+
+    public Date getAssignmentDate() {
+        return assignmentDate;
+    }
+
+    public void setAssignmentDate(Date assignmentDate) {
+        this.assignmentDate = assignmentDate;
+    }
+
+    public Date getExpiringDate() {
+        return expiringDate;
+    }
+
+    public void setExpiringDate(Date expiringDate) {
+        this.expiringDate = expiringDate;
+    }
+
+    public Date getDeletionLockUntil() {
+        return deletionLockUntil;
+    }
+
+    public void setDeletionLockUntil(Date deletionLockUntil) {
+        this.deletionLockUntil = deletionLockUntil;
+    }
+
+    public String getAssignmentNote() {
+        return assignmentNote;
+    }
+
+    public void setAssignmentNote(String assignmentNote) {
+        this.assignmentNote = assignmentNote;
+    }
+}
diff --git a/src/main/resources/backendConfigDevLocal.json b/src/main/resources/backendConfigDevLocal.json
index 9793bed..9f954f6 100644
--- a/src/main/resources/backendConfigDevLocal.json
+++ b/src/main/resources/backendConfigDevLocal.json
@@ -1,6 +1,7 @@
 {
   "portalBaseURL" : "http://localhost:8080/portal/rest/beservice",
   "contactBaseDataApiUrl" : "http://localhost:9155",
+  "elogbookModuleName" : "Betriebstagebuch local 4200",
 
   "fileRowToRead": "9",
   "importFilesFolderPath": "C:/FilesToImport",
@@ -22,8 +23,7 @@
 
   "_cronSyncContacts": "0 0 1 * * ?",
   "cronSyncContacts": "0 0/1 * * * ?",
-  "enableContactSyncJob": true,
+  "enableContactSyncJob": false,
   "contactServiceTechUser": "admin",
   "contactServiceTechUserPwd": "admin"
-
 }
diff --git a/src/main/resources/backendConfigDevServer.json b/src/main/resources/backendConfigDevServer.json
index 6d8031c..e4cbf8f 100644
--- a/src/main/resources/backendConfigDevServer.json
+++ b/src/main/resources/backendConfigDevServer.json
@@ -1,6 +1,7 @@
 {
-  "portalBaseURL" : "http://172.17.34.78:8880/portal/rest/beservice",
+  "portalBaseURL" : "http://entopkon:8880/portal/rest/beservice",
   "contactBaseDataApiUrl" : "http://localhost:9155",
+  "elogbookModuleName" : "Betriebstagebuch",
 
   "fileRowToRead": "9",
   "importFilesFolderPath": "/opt/opkon/btb_filesToImport",
diff --git a/src/main/resources/backendConfigProduction.json b/src/main/resources/backendConfigProduction.json
index b5bc551..552eb11 100644
--- a/src/main/resources/backendConfigProduction.json
+++ b/src/main/resources/backendConfigProduction.json
@@ -1,5 +1,8 @@
 {
   "portalBaseURL" : "http://localhost:8080/portal/rest/beservice",
+  "contactBaseDataApiUrl" : "http://localhost:9155",
+  "elogbookModuleName" : "Betriebstagebuch",
+
   "fileRowToRead": "9",
   "importFilesFolderPath": "/home/btbservice/importFiles",
   "activePersistencyUnit": "betriebstagebuch",
@@ -22,5 +25,4 @@
   "enableContactSyncJob": true,
   "contactServiceTechUser": "admin",
   "contactServiceTechUserPwd": "admin"
-
-}
\ No newline at end of file
+}
diff --git a/src/test/java/org/eclipse/openk/elogbook/controller/ControllerImplementationsTest.java b/src/test/java/org/eclipse/openk/elogbook/controller/ControllerImplementationsTest.java
index 5087479..e5d33f9 100644
--- a/src/test/java/org/eclipse/openk/elogbook/controller/ControllerImplementationsTest.java
+++ b/src/test/java/org/eclipse/openk/elogbook/controller/ControllerImplementationsTest.java
@@ -314,9 +314,9 @@
     public void testCreateNotification() throws BtbException {
         String json = super.loadStringFromResource("testSingleNotification.json");
 
-        ControllerImplementations.CreateNotification controllerImpl = new ControllerImplementations.CreateNotification(json, beMockNotification);
+        ControllerImplementations.CreateNotification controllerImpl = new ControllerImplementations.CreateNotification(json, beMockNotification, "fakeToken");
 
-        expect(beMockNotification.createNotification(anyObject(), anyObject())).andReturn(new Notification());
+        expect(beMockNotification.createNotification(anyObject(), anyObject(), anyString())).andReturn(new Notification());
         PowerMock.replay(beMockNotification);
 
         assertEquals(controllerImpl.invoke().getStatus(), HttpStatus.SC_OK);
@@ -324,9 +324,9 @@
 
     @Test(expected = BtbBadRequest.class)
     public void testCreateNotification_null() throws BtbException {
-        ControllerImplementations.CreateNotification controllerImpl = new ControllerImplementations.CreateNotification(null, beMockNotification);
+        ControllerImplementations.CreateNotification controllerImpl = new ControllerImplementations.CreateNotification(null, beMockNotification, "fakeToken");
 
-        expect(beMockNotification.createNotification(anyObject(), anyObject())).andReturn(new Notification());
+        expect(beMockNotification.createNotification(anyObject(), anyObject(), anyString())).andReturn(new Notification());
         PowerMock.replay(beMockNotification);
 
         assertEquals(controllerImpl.invoke().getStatus(), HttpStatus.SC_OK);