From 91bb9e2807916347e2cc669b85cdeac635e0038b Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Fri, 4 Nov 2022 10:17:56 +0100
Subject: [PATCH] OZG-2737 OZG-2950 fix/adjust E2E Tests; cleanup

---
 Jenkinsfile                                   | 19 ++++++++++++
 goofy-client/apps/goofy-e2e/cypress.json      |  4 +++
 .../apps/goofy-e2e/docker-compose.yml         |  7 ++++-
 .../src/fixtures/user/user_sabine.json        |  1 +
 .../usermanager/usermanager_user_emil.json    | 19 ++++++++++++
 .../usermanager/usermanager_user_peter.json   | 19 ++++++++++++
 .../usermanager/usermanager_user_sabine.json  | 22 ++++++++++++++
 .../navigation/navigation.e2e-spec.ts         |  4 +--
 .../main-tests/app/buildinfo.e2e-spec.ts      | 14 ++++-----
 .../main-tests/historie/historie.e2e-spec.ts  |  9 ++----
 .../kommentar/kommentar.e2e-spec.ts           |  8 ++---
 .../navigation/navigation.e2e-spec.ts         | 15 +++++-----
 ...r-profile-icon-assign-unassign.e2e-spec.ts | 10 +++----
 ...on-in-postfach-nachricht-error.e2e-spec.ts |  6 ++--
 ...-profile-icon-in-vorgang-error.e2e-spec.ts |  6 ++--
 .../user-settings/user-settings.e2e-spec.ts   |  8 ++---
 .../vorgang-zurueckstellen.e2e-spec.ts        |  7 ++---
 .../apps/goofy-e2e/src/model/usermanager.ts   |  2 +-
 .../apps/goofy-e2e/src/plugins/index.js       | 26 ++++++++++++++++-
 .../apps/goofy-e2e/src/support/commands.ts    |  3 +-
 .../goofy-e2e/src/support/cypress-helper.ts   |  4 +--
 .../apps/goofy-e2e/src/support/user-util.ts   | 29 +++++++++++++++----
 .../apps/goofy-e2e/start-e2e-environment.sh   | 12 +++++---
 23 files changed, 187 insertions(+), 67 deletions(-)
 create mode 100644 goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json
 create mode 100644 goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json
 create mode 100644 goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json

diff --git a/Jenkinsfile b/Jenkinsfile
index c3594e6b76..c3b703a317 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -617,6 +617,8 @@ String generateCypressConfig(String stage, String bezeichner, String testFolder)
 
         environment = config.env
         environment.put("search", elasticsearchEnv)
+        
+        environment.put("userManager", getUserManagerEnv(namespace));
 
         writeJSON file: configName, json: config
 
@@ -626,6 +628,23 @@ String generateCypressConfig(String stage, String bezeichner, String testFolder)
     return configName
 }
 
+String getUserManagerEnv(namespace){
+	def secret = getSecrect(namespace, 'pluto-database-admin-user-manager-database-user');
+	def secretPassword = decodeString(secret.password);
+	return readJSON(text: """{
+        "dbUrl":"mongodb+srv://user-manager-database-user:${secretPassword}@pluto-database-svc.${namespace}.svc.cluster.local/admin?ssl=false", \
+        "database":"user-manager-database"}""");
+}
+
+def getSecrect(namespace, secretName){
+    container("k8s"){
+        script {
+            return readJSON ( text: sh (script: "kubectl get secret ${secretName} -n ${namespace} -o jsonpath={.data}", returnStdout: true))
+        }
+    }
+}
+
+
 String getKeycloakUuid(realm, userName) {
     def shScript = """curl -H 'Content-Type: application/json' \
                         -H 'Authorization: bearer ${getKeycloakAccessToken()}' \
diff --git a/goofy-client/apps/goofy-e2e/cypress.json b/goofy-client/apps/goofy-e2e/cypress.json
index a96b1ba8ac..a68a50042b 100644
--- a/goofy-client/apps/goofy-e2e/cypress.json
+++ b/goofy-client/apps/goofy-e2e/cypress.json
@@ -12,6 +12,10 @@
 			"index": "e2e-test-index",
 			"user": "elastic",
 			"password": "password"
+		},
+		"userManager": {
+			"dbUrl": "mongodb://localhost:27018",
+			"database": "usermanager"
 		}
 	},
 	"fileServerFolder": ".",
diff --git a/goofy-client/apps/goofy-e2e/docker-compose.yml b/goofy-client/apps/goofy-e2e/docker-compose.yml
index 26654de47c..b3efc1f9f9 100644
--- a/goofy-client/apps/goofy-e2e/docker-compose.yml
+++ b/goofy-client/apps/goofy-e2e/docker-compose.yml
@@ -7,6 +7,7 @@ services:
       - 27018:27017
     environment:
       - MONGODB_EXTRA_FLAGS=--profile=2
+
   ozg-pluto:
     image: docker.ozg-sh.de/pluto:snapshot-latest
     environment:
@@ -28,10 +29,12 @@ services:
     environment:
       - GRPC_CLIENT_PLUTO_ADDRESS=static://ozg-pluto:9090
       - SPRING_PROFILES_ACTIVE=remotekc, e2e
+      - KOP_USER-MANAGER_URL=http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:9092
     ports:
       - 8080:8080
     depends_on:
       - ozg-pluto
+      - ozg-usermanager
 
   ozg-elastic:
     image: docker.elastic.co/elasticsearch/elasticsearch:8.3.2
@@ -52,6 +55,7 @@ services:
       nofile:
         soft: 65536
         hard: 65536
+
   ozg-usermanager:
     image: docker.ozg-sh.de/user-manager:snapshot-latest
     environment:
@@ -62,10 +66,11 @@ services:
       - KOP_KEYCLOAK_API_PASSWORD= 
       - KOP_KEYCLOAK_API_REALM=sh-e2e-dev
       - KOP_KEYCLOAK_API_CLIENT=sh-e2e-dev-goofy
+      - KOP_KEYCLOAK_SYNC_CRON=5 */5 * * * ?
       - KEYCLOAK_URL=https://sso.dev.ozg-sh.de
       - KOP_USER_MANAGER_URL=http://localhost:9092
       - QUARKUS_MONGODB_CONNECTION_STRING=mongodb://ozg-mongodb:27017
-      - QUARKUS_MONGODB_DATABASE=test
+      - QUARKUS_MONGODB_DATABASE=usermanager
       - quarkus.log.category."io.quarkus.oidc.runtime.OidcProvider".level=TRACE
       - quarkus.log.category."io.quarkus.oidc.runtime.OidcProvider".min-level=TRACE
     ports:
diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json b/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json
index f9f8399bc7..130d36c8ec 100644
--- a/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json
+++ b/goofy-client/apps/goofy-e2e/src/fixtures/user/user_sabine.json
@@ -4,6 +4,7 @@
 	"firstName": "Sabine",
 	"lastName": "Sach",
 	"fullName": "Sabine Sach",
+	"email": "susanne.fischer.dataport+sabine@gmail.com",
 	"initials": "SS",
 	"dataTestId": "Sabine_Sach",
 	"clientRoles": ["VERWALTUNG_USER"],
diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json
new file mode 100644
index 0000000000..7457bc3c97
--- /dev/null
+++ b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_emil.json
@@ -0,0 +1,19 @@
+{
+	"_id": {
+	  "$oid": "63284e54c39b316b2ad02e2a"
+	},
+	"createdAt": {
+	  "$date": "2022-08-25T08:29:45.025Z"
+	},
+	"deleted": false,
+	"externalId": "108ee867-7290-466d-813f-ab1dc95d3691",
+	"firstName": "Emil",
+	"fullName": "Emil Ansprechpartner",
+	"lastName": "Ansprechpartner",
+	"lastSyncTimestamp": 1663585874687,
+	"organisationsEinheitIds": [],
+	"roles": [
+	  "EINHEITLICHER_ANSPRECHPARTNER"
+	],
+	"username": "emil"
+  }
\ No newline at end of file
diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json
new file mode 100644
index 0000000000..9a68d870b8
--- /dev/null
+++ b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_peter.json
@@ -0,0 +1,19 @@
+{
+	"_id": {
+	  "$oid": "63284e55c39b316b2ad02e2c"
+	},
+	"createdAt": {
+	  "$date": "2022-02-18T09:21:24.340Z"
+	},
+	"deleted": false,
+	"externalId": "63d42f8f-303b-4560-9b11-e9211b0ae87e",
+	"firstName": "Peter",
+	"fullName": "Peter von der Post",
+	"lastName": "von der Post",
+	"lastSyncTimestamp": 1663585874687,
+	"organisationsEinheitIds": [],
+	"roles": [
+	  "VERWALTUNG_POSTSTELLE"
+	],
+	"username": "peter"
+  }
\ No newline at end of file
diff --git a/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json
new file mode 100644
index 0000000000..b33ffad9ef
--- /dev/null
+++ b/goofy-client/apps/goofy-e2e/src/fixtures/usermanager/usermanager_user_sabine.json
@@ -0,0 +1,22 @@
+{
+	"_id": {
+	  "$oid": "63284e55c39b316b2ad02e2d"
+	},
+	"createdAt": {
+	  "$date": "2021-12-20T11:17:56.489Z"
+	},
+	"deleted": false,
+	"email": "susanne.fischer.dataport+sabine@gmail.com",
+	"externalId": "203002d1-c25f-4722-a9aa-a4291e0184bc",
+	"firstName": "Sabine",
+	"fullName": "Sabine Sach",
+	"lastName": "Sach",
+	"lastSyncTimestamp": 1663585874687,
+	"organisationsEinheitIds": [
+	  "12345678"
+	],
+	"roles": [
+	  "VERWALTUNG_USER"
+	],
+	"username": "sabine"
+  }
\ No newline at end of file
diff --git a/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts
index a59c96b3a1..c0fcd0535b 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/einheitlicher-ansprechpartner/navigation/navigation.e2e-spec.ts
@@ -5,7 +5,7 @@ import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper';
 import { exist, notExist } from 'apps/goofy-e2e/src/support/cypress.util';
 import { loginAsEmil } from 'apps/goofy-e2e/src/support/user-util';
 
-describe.skip('Navigation', () => {
+describe('Navigation', () => {
 	const mainPage: MainPage = new MainPage();
 	const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
 
@@ -22,7 +22,7 @@ describe.skip('Navigation', () => {
 		dropCollections();
 	})
 
-	describe('FIXME(OZG-2950 UserManager)  navigation item myVorgaenge', () => {
+	describe('navigation item myVorgaenge', () => {
 
 		it('should not exists', () => {
 			notExist(navigation.getMyVorgaengeItem());
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts
index 4108854f86..2173435c27 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/app/buildinfo.e2e-spec.ts
@@ -1,11 +1,11 @@
-import { BuildInfoE2EComponent } from "apps/goofy-e2e/src/components/buildinfo/buildinfo.e2e.component";
-import { VorgangListE2EComponent } from "apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component";
-import { MainPage, waitForSpinnerToDisappear } from "apps/goofy-e2e/src/page-objects/main.po";
-import { dropCollections } from "apps/goofy-e2e/src/support/cypress-helper";
-import { exist } from "apps/goofy-e2e/src/support/cypress.util";
-import { loginAsSabine } from "apps/goofy-e2e/src/support/user-util";
+import { BuildInfoE2EComponent } from 'apps/goofy-e2e/src/components/buildinfo/buildinfo.e2e.component';
+import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component';
+import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po';
+import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper';
+import { exist } from 'apps/goofy-e2e/src/support/cypress.util';
+import { loginAsSabine } from 'apps/goofy-e2e/src/support/user-util';
 
-describe.skip('FIXME(OZG-2950 UserManager) Buildinfo', () => {
+describe('Buildinfo', () => {
 	const mainPage: MainPage = new MainPage();
 	const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
 	const buildInfo: BuildInfoE2EComponent = mainPage.getBuildInfo();
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts
index 3b9116cfd1..6d05a982a8 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/historie/historie.e2e-spec.ts
@@ -5,7 +5,6 @@ import { KommentarHistorieItemE2EComponent, PostfachNachrichtHistorieItemE2EComp
 import { CommandE2E, CommandOrderE2E } from 'apps/goofy-e2e/src/model/command';
 import { HistorieAttachmentE2E, HistorieHeadlineE2E, SYSTEM_USER_NAME } from 'apps/goofy-e2e/src/model/historie';
 import { PostfachE2E } from 'apps/goofy-e2e/src/model/postfach-nachricht';
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { DirectionE2E } from 'apps/goofy-e2e/src/model/vorgang-attached-item';
 import { buildCommand, createCommand, initCommands } from 'apps/goofy-e2e/src/support/command-util';
 import { createKommentar } from 'apps/goofy-e2e/src/support/kommentar.util';
@@ -19,7 +18,7 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.
 import { VorgangPage } from '../../../page-objects/vorgang.po';
 import { dropCollections } from '../../../support/cypress-helper';
 import { contains, exist, notExist } from '../../../support/cypress.util';
-import { createUsermanagerUsers, getUserSabine, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabine, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
 import { createVorgang, initVorgang } from '../../../support/vorgang-util';
 
 registerLocaleData(localeDe, 'de', localeDeExtra);
@@ -35,8 +34,6 @@ describe('Historie', () => {
 
 	const vorgang: VorgangE2E = createVorgang();
 
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
-
 	const assignUserCommand: CommandE2E = {
 		...buildCommand(CommandOrderE2E.ASSIGN_USER, vorgang._id.$oid, vorgang._id.$oid),
 		bodyObject: { assignedTo: getUserSabineUuid() },
@@ -139,7 +136,7 @@ describe('Historie', () => {
 			sendPostfachMailCommand, sendPostfachNachrichtCommand, receivePostfachNachrichtCommand,
 			createWiedervorlageCommand, editWiedervorlageCommand, wiedervorlageErledigenCommand, wiedervorlageWiedereroeffnenCommand
 		]);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
@@ -175,7 +172,7 @@ describe('Historie', () => {
 				exist(vorgangDatenFormular.getHistorieContainer().getCreatedAt());
 			})
 
-			describe.skip('FIXME(OZG-2950 UserManager) should show historie item for', () => {
+			describe('should show historie item for', () => {
 
 				const userName: string = `${getUserSabine().firstName} ${getUserSabine().lastName}`;
 
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts
index 9836191616..233b132420 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/kommentar/kommentar.e2e-spec.ts
@@ -1,4 +1,3 @@
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { KommentareInVorgangE2EComponent } from '../../../components/kommentar/kommentar-list.e2e.component';
 import { UserE2E } from '../../../model/user';
 import { VorgangE2E } from '../../../model/vorgang';
@@ -6,10 +5,10 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.
 import { VorgangPage } from '../../../page-objects/vorgang.po';
 import { dropCollections } from '../../../support/cypress-helper';
 import { contains, exist, haveText, notExist } from '../../../support/cypress.util';
-import { createUsermanagerUsers, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
 import { createVorgang, initVorgang } from '../../../support/vorgang-util';
 
-describe.skip('FIXME(OZG-2950 UserManager) Kommentar', () => {
+describe('Kommentar', () => {
 	const mainPage: MainPage = new MainPage();
 
 	const vorgangPage: VorgangPage = new VorgangPage();
@@ -18,12 +17,11 @@ describe.skip('FIXME(OZG-2950 UserManager) Kommentar', () => {
 	const kommentarText: string = 'Test text to test the test text test';
 
 	const vorgang: VorgangE2E = createVorgang();
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 	const userSabine: UserE2E = getUserSabine();
 
 	before(() => {
 		initVorgang(vorgang);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts
index 75ff277597..bee58f1551 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/navigation/navigation.e2e-spec.ts
@@ -1,31 +1,32 @@
 import { NavigationE2EComponent } from 'apps/goofy-e2e/src/components/navigation/navigation.e2e.component';
 import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component';
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
+import { UsermanagerUserE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { VorgangE2E } from 'apps/goofy-e2e/src/model/vorgang';
 import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po';
 import { dropCollections } from 'apps/goofy-e2e/src/support/cypress-helper';
 import { CypressKeyboardActions, exist, notExist } from 'apps/goofy-e2e/src/support/cypress.util';
-import { createUsermanagerUsers, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util';
 import { buildVorgang, createVorgang, initSearchIndex, initVorgaenge, objectIds } from 'apps/goofy-e2e/src/support/vorgang-util';
 
-describe.skip('FIXME(OZG-2950 UserManager) Navigation', () => {
+describe('Navigation', () => {
 	const mainPage: MainPage = new MainPage();
 	const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
 
 	const navigation: NavigationE2EComponent = mainPage.getNavigation();
 
+	const usermanagerUserSabine: UsermanagerUserE2E = getUserManagerUserSabine();
+
 	const vorgang: VorgangE2E = createVorgang();
 	const vorgangNotBeFiltered: VorgangE2E = { ...buildVorgang(objectIds[0], 'vorgangNotBeFiltered') };
-	const vorgangAssigned: VorgangE2E = { ...buildVorgang(objectIds[1], 'vorgangAssigned'), assignedTo: getUserSabineUuid() };
-	const vorgangAssignedNotBeFiltered: VorgangE2E = { ...buildVorgang(objectIds[2], 'vorgangAssignedNotBeFiltered'), assignedTo: getUserSabineUuid() };
+	const vorgangAssigned: VorgangE2E = { ...buildVorgang(objectIds[1], 'vorgangAssigned'), assignedTo: usermanagerUserSabine.externalId };
+	const vorgangAssignedNotBeFiltered: VorgangE2E = { ...buildVorgang(objectIds[2], 'vorgangAssignedNotBeFiltered'), assignedTo: usermanagerUserSabine.externalId };
 
 	const searchString: string = 'NotBeFiltered';
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 
 	before(() => {
 		initVorgaenge([vorgang, vorgangNotBeFiltered, vorgangAssigned, vorgangAssignedNotBeFiltered]);
 		initSearchIndex([vorgang, vorgangNotBeFiltered, vorgangAssigned, vorgangAssignedNotBeFiltered]);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([usermanagerUserSabine, getUserManagerUserEmil(), getUserManagerUserPeter()]);
 
 		loginAsSabine();
 
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts
index 8f222c2543..0f50e198e0 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-assign-unassign.e2e-spec.ts
@@ -1,4 +1,3 @@
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { UserProfileE2EComponent } from '../../../components/user-profile/user-profile.component.e2e';
 import { VorgangListItemE2EComponent } from '../../../components/vorgang/vorgang-item.e2e.component';
 import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
@@ -8,7 +7,7 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.
 import { VorgangPage } from '../../../page-objects/vorgang.po';
 import { dropCollections } from '../../../support/cypress-helper';
 import { enterWith, exist, haveText, notExist } from '../../../support/cypress.util';
-import { createUsermanagerUsers, getUserEmil, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
+import { getUserEmil, getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
 import { createVorgang, initVorgang } from '../../../support/vorgang-util';
 
 describe('User Profile im ausgewählten Vorgang', () => {
@@ -19,14 +18,13 @@ describe('User Profile im ausgewählten Vorgang', () => {
 	const userProfileContainer: UserProfileE2EComponent = vorgangPage.getVorgangDetailHeader().getUserContainer();
 
 	const vorgang: VorgangE2E = createVorgang();
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 
 	const userSabine: UserE2E = getUserSabine();
 	const userEmil: UserE2E = getUserEmil();
 
 	before(() => {
 		initVorgang(vorgang);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
@@ -132,7 +130,7 @@ describe('User Profile im ausgewählten Vorgang', () => {
 				exist(userProfileContainer.getSearchContainer().getRoot());
 			})
 
-			describe.skip('FIXME(OZG-2950 UserManager) on valid formular', () => {
+			describe('on valid formular', () => {
 
 				it('should hide formular', () => {
 					userProfileContainer.getSearchContainer().getInput().clear().type(userEmil.name);
@@ -150,7 +148,7 @@ describe('User Profile im ausgewählten Vorgang', () => {
 			})
 		})
 
-		describe.skip('FIXME(OZG-2950 UserManager) navigate to list', () => {
+		describe('navigate to list', () => {
 
 			it('should show assigned icon', () => {
 				vorgangPage.getSubnavigation().clickBackButton();
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts
index 744176710b..1303ec69dd 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-postfach-nachricht-error.e2e-spec.ts
@@ -1,4 +1,3 @@
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { PostfachMailE2EComponent } from '../../../components/postfach/postfach-mail.e2e.component';
 import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
 import { HttpMethodE2E, MessageCodeE2E } from '../../../model/util';
@@ -8,7 +7,7 @@ import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.
 import { VorgangPage } from '../../../page-objects/vorgang.po';
 import { dropCollections, interceptWithResponse, waitOfInterceptor } from '../../../support/cypress-helper';
 import { exist, notExist } from '../../../support/cypress.util';
-import { createUsermanagerUsers, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
 import { createPostfachNachrichtReplyItem, createVorgangAttachedItem, initVorgangAttachedItem } from '../../../support/vorgang-attached-item-util';
 import { createVorgang, initVorgang } from '../../../support/vorgang-util';
 
@@ -20,7 +19,6 @@ describe('Postfach nachricht user profile on backend error', () => {
 	const postfachNachrichtenContainer: PostfachMailE2EComponent = vorgangPage.getPostfachMailcontainer();
 
 	const vorgang: VorgangE2E = createVorgang();
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 
 	const postfachMailItem: PostfachMailItemE2E = {
 		...createPostfachNachrichtReplyItem(),
@@ -34,7 +32,7 @@ describe('Postfach nachricht user profile on backend error', () => {
 	before(() => {
 		initVorgang(vorgang);
 		initVorgangAttachedItem([vorgangAttachedItem]);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts
index 255c2668a9..d4b0889c6f 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-profile/user-profile-icon-in-vorgang-error.e2e-spec.ts
@@ -1,4 +1,3 @@
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { UserProfileIconE2EComponent } from '../../../components/user-profile/user-profile-icon.component.e2e';
 import { UserProfileE2EComponent } from '../../../components/user-profile/user-profile.component.e2e';
 import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
@@ -10,7 +9,7 @@ import { hasTooltip } from '../../../support/angular.util';
 import { dropCollections, interceptWithResponse, waitOfInterceptor } from '../../../support/cypress-helper';
 import { exist } from '../../../support/cypress.util';
 import { MessagesE2E } from '../../../support/messages';
-import { createUsermanagerUsers, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
 import { createVorgang, initVorgang } from '../../../support/vorgang-util';
 
 describe('User profile assigned to vorgang', () => {
@@ -21,11 +20,10 @@ describe('User profile assigned to vorgang', () => {
 	const userProfileContainer: UserProfileE2EComponent = vorgangPage.getVorgangDetailHeader().getUserContainer();
 
 	const vorgang: VorgangE2E = { ...createVorgang(), assignedTo: '6287e7507433b51bfc87cfe9' };
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 
 	before(() => {
 		initVorgang(vorgang);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts
index 884b839d27..c222078849 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/user-settings/user-settings.e2e-spec.ts
@@ -1,27 +1,25 @@
 import { UserSettingsE2EComponent } from 'apps/goofy-e2e/src/components/user-settings/user-settings.component.e2e';
 import { VorgangListE2EComponent } from 'apps/goofy-e2e/src/components/vorgang/vorgang-list.e2e.component';
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { VorgangE2E } from 'apps/goofy-e2e/src/model/vorgang';
 import { HeaderE2EComponent } from 'apps/goofy-e2e/src/page-objects/header.po';
 import { MainPage, waitForSpinnerToDisappear } from 'apps/goofy-e2e/src/page-objects/main.po';
 import { isChecked, isNotChecked } from 'apps/goofy-e2e/src/support/angular.util';
 import { dropCollections, reload } from 'apps/goofy-e2e/src/support/cypress-helper';
 import { exist } from 'apps/goofy-e2e/src/support/cypress.util';
-import { createUsermanagerUsers, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, initUsermanagerUsers, loginAsSabine } from 'apps/goofy-e2e/src/support/user-util';
 import { createVorgang, initVorgang } from 'apps/goofy-e2e/src/support/vorgang-util';
 
-describe.skip('FIXME(OZG-2950 UserManager) User Settings', () => {
+describe('User Settings', () => {
 	const mainPage: MainPage = new MainPage();
 	const vorgangList: VorgangListE2EComponent = mainPage.getVorgangList();
 	const header: HeaderE2EComponent = mainPage.getHeader();
 	const userSettings: UserSettingsE2EComponent = header.getUserSettings();
 
 	const vorgang: VorgangE2E = createVorgang();
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 
 	before(() => {
 		initVorgang(vorgang);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
diff --git a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts
index 70b7cc5823..62e822e055 100644
--- a/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts
+++ b/goofy-client/apps/goofy-e2e/src/integration/main-tests/vorgang-detailansicht/vorgang-zurueckstellen.e2e-spec.ts
@@ -5,13 +5,12 @@ import { VorgangFormularButtonsE2EComponent } from 'apps/goofy-e2e/src/component
 import { SnackBarE2EComponent } from '../../../components/ui/snackbar.e2e.component';
 import { UserProfileE2EComponent } from '../../../components/user-profile/user-profile.component.e2e';
 import { VorgangListE2EComponent } from '../../../components/vorgang/vorgang-list.e2e.component';
-import { UsermanagerE2E } from 'apps/goofy-e2e/src/model/usermanager';
 import { VorgangE2E, VorgangMessagesE2E, VorgangStatusE2E, vorgangStatusLabelE2E } from '../../../model/vorgang';
 import { MainPage, waitForSpinnerToDisappear } from '../../../page-objects/main.po';
 import { VorgangPage } from '../../../page-objects/vorgang.po';
 import { dropCollections } from '../../../support/cypress-helper';
 import { contains, exist, haveText, notExist } from '../../../support/cypress.util';
-import { getUserSabineUuid, loginAsSabine, createUsermanagerUsers, initUsermanagerUsers } from '../../../support/user-util';
+import { getUserManagerUserEmil, getUserManagerUserPeter, getUserManagerUserSabine, getUserSabineUuid, initUsermanagerUsers, loginAsSabine } from '../../../support/user-util';
 import { buildVorgang, createVorgang, initVorgaenge, objectIds } from '../../../support/vorgang-util';
 
 registerLocaleData(localeDe, 'de', localeDeExtra);
@@ -27,12 +26,10 @@ describe('Vorgang Zurueckstellen', () => {
 
 	const vorgangZurueckstellen: VorgangE2E = { ...createVorgang(), name: 'DoBescheiden', status: VorgangStatusE2E.IN_BEARBEITUNG, assignedTo: getUserSabineUuid() };
 	const vorgangZurueckstellenRevoke: VorgangE2E = { ...buildVorgang(objectIds[0], 'DoRevokeBescheiden'), status: VorgangStatusE2E.IN_BEARBEITUNG };
-	
-	const users: UsermanagerE2E[] = createUsermanagerUsers();
 
 	before(() => {
 		initVorgaenge([vorgangZurueckstellen, vorgangZurueckstellenRevoke]);
-		initUsermanagerUsers(users);
+		initUsermanagerUsers([getUserManagerUserSabine(), getUserManagerUserPeter(), getUserManagerUserEmil()]);
 
 		loginAsSabine();
 
diff --git a/goofy-client/apps/goofy-e2e/src/model/usermanager.ts b/goofy-client/apps/goofy-e2e/src/model/usermanager.ts
index 0b2f0922fa..85eb5fb058 100644
--- a/goofy-client/apps/goofy-e2e/src/model/usermanager.ts
+++ b/goofy-client/apps/goofy-e2e/src/model/usermanager.ts
@@ -1,6 +1,6 @@
 import { DateE2E, ObjectIdE2E } from './util';
 
-export interface UsermanagerE2E {
+export interface UsermanagerUserE2E {
 	_id: ObjectIdE2E;
 	createdAt: DateE2E;
 	deleted: boolean;
diff --git a/goofy-client/apps/goofy-e2e/src/plugins/index.js b/goofy-client/apps/goofy-e2e/src/plugins/index.js
index abe59cd490..232ec66bc7 100644
--- a/goofy-client/apps/goofy-e2e/src/plugins/index.js
+++ b/goofy-client/apps/goofy-e2e/src/plugins/index.js
@@ -49,7 +49,7 @@ module.exports = (on, config) => {
 		},
 		initUsermanagerData({collection, data}) {
 			console.log('initUsermanagerData');
-			insertIntoDatabase(config, collection, parseUserData(data));
+			insertIntoUserManagerDatabase(config, collection, parseUserData(data));
 			return 0;
 		},
 		dropCollections(collections) {
@@ -216,12 +216,16 @@ function createNumberLong(numberValue){
 
 function insertIntoDatabase(config, collection, data) {
 	MongoClient.connect(buildDatabaseUrl(config), (error, connection) => {
+		console.log('connect to database...')
 		if (!error) {
+			console.log('success');
 			var db = connection.db(config.env.database);
 
 			db.collection(collection).drop(() => {
 				db.createCollection(collection, (error) => handleCreateCollection(db, connection, collection, data, error));
 			});
+		} else {
+			console.log('fail', error);
 		}
 	});
 }
@@ -267,4 +271,24 @@ function dropCollectionsFromDatabase(config, collections) {
 
 function buildDatabaseUrl(config) {
 	return config.env.dbUrl;
+}
+
+function insertIntoUserManagerDatabase(config, collection, data){
+	MongoClient.connect(buildUsermanagerDatabaseUrl(config), (error, connection) => {
+		console.log('connect to database...')
+		if (!error) {
+			console.log('success');
+			var db = connection.db(config.env.userManager.database);
+
+			db.collection(collection).drop(() => {
+				db.createCollection(collection, (error) => handleCreateCollection(db, connection, collection, data, error));
+			});
+		} else {
+			console.log('fail', error);
+		}
+	});
+}
+
+function buildUsermanagerDatabaseUrl(config){
+	return config.env.userManager.dbUrl;
 }
\ No newline at end of file
diff --git a/goofy-client/apps/goofy-e2e/src/support/commands.ts b/goofy-client/apps/goofy-e2e/src/support/commands.ts
index 70d4bd40fa..08597bf6ad 100644
--- a/goofy-client/apps/goofy-e2e/src/support/commands.ts
+++ b/goofy-client/apps/goofy-e2e/src/support/commands.ts
@@ -116,7 +116,8 @@ function buildSearchIndexBody(vorgang) {
 		'antragstellerVorname': vorgang.eingangs[0].antragsteller.vorname,
 		'status': vorgang.status,
 		'organisationseinheitenId': vorgang.eingangs[0].zustaendigeStelle.organisationseinheitenId,
-		'aktenzeichen': vorgang.aktenzeichen
+		'aktenzeichen': vorgang.aktenzeichen,
+		'assignedTo': vorgang.assignedTo
 	};
 }
 
diff --git a/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts b/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts
index fd650201d8..91b16ab541 100644
--- a/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts
+++ b/goofy-client/apps/goofy-e2e/src/support/cypress-helper.ts
@@ -1,7 +1,7 @@
 import { Interception, RouteHandler, RouteMatcher } from 'cypress/types/net-stubbing';
 import { GridFsChunkE2E, GridFsFileDataE2E, GridFsFileE2E } from '../model/binary-file';
 import { CommandE2E } from '../model/command';
-import { UsermanagerE2E } from '../model/usermanager';
+import { UsermanagerUserE2E } from '../model/usermanager';
 import { VorgangE2E } from '../model/vorgang';
 import { VorgangAttachedItemE2E } from '../model/vorgang-attached-item';
 
@@ -75,7 +75,7 @@ export function initSearchIndexData(vorgaenge: VorgangE2E[]): void {
 	})
 }
 
-export function initUsermanagerData(data: UsermanagerE2E[]): void {
+export function initUsermanagerData(data: UsermanagerUserE2E[]): void {
 	cy.task(CypressTasks.INIT_USERMANAGER_DATA, { collection: MongoCollections.USER, data });
 }
 
diff --git a/goofy-client/apps/goofy-e2e/src/support/user-util.ts b/goofy-client/apps/goofy-e2e/src/support/user-util.ts
index dabccc741f..61eaf2668f 100644
--- a/goofy-client/apps/goofy-e2e/src/support/user-util.ts
+++ b/goofy-client/apps/goofy-e2e/src/support/user-util.ts
@@ -1,16 +1,15 @@
 import { UserE2E } from '../model/user';
-import { UsermanagerE2E } from '../model/usermanager';
+import { UsermanagerUserE2E } from '../model/usermanager';
 import { getCypressEnv, initUsermanagerData, login } from './cypress-helper';
 
 const sabineFixture: UserE2E = require('../fixtures/user/user_sabine.json');
 const emilFixture: UserE2E = require('../fixtures/user/user_emil.json');
-const usersFixture: UsermanagerE2E[] = require('../fixtures/usermanager/users.json');
 
-export function createUsermanagerUsers(): UsermanagerE2E[] {
-	return usersFixture;
-}
+const userManagerSabineFixture: UsermanagerUserE2E = require('../fixtures/usermanager/usermanager_user_sabine.json');
+const userManagerPeterFixture: UsermanagerUserE2E = require('../fixtures/usermanager/usermanager_user_peter.json');
+const userManagerEmilFixture: UsermanagerUserE2E = require('../fixtures/usermanager/usermanager_user_emil.json');
 
-export function initUsermanagerUsers(users: UsermanagerE2E[]) {
+export function initUsermanagerUsers(users: UsermanagerUserE2E[]) {
 	initUsermanagerData(users);
 }
 
@@ -22,10 +21,28 @@ export function getUserSabine(): UserE2E {
 	return sabineFixture;
 }
 
+export function getUserManagerUserSabine(): UsermanagerUserE2E {
+	var user: UsermanagerUserE2E = userManagerSabineFixture;
+	user.externalId = getUserSabineUuid();
+	return user;
+}
+
+export function getUserManagerUserPeter(): UsermanagerUserE2E {
+	return userManagerPeterFixture;
+}
+
+export function getUserManagerUserEmil(): UsermanagerUserE2E {
+	return userManagerEmilFixture;
+}
+
 export function getUserSabineUuid(): string {
 	return getCypressEnv('sabineUuid');
 }
 
+export function getUserSabineInternalId(): string {
+	return '63284e55c39b316b2ad02e2d';
+}
+
 enum DatabaseUser {
 	EMIL = 'user/user_emil.json',
 	KFINDER = 'user/user_kfinder.json',
diff --git a/goofy-client/apps/goofy-e2e/start-e2e-environment.sh b/goofy-client/apps/goofy-e2e/start-e2e-environment.sh
index c50c2badaa..cb35b1ea66 100755
--- a/goofy-client/apps/goofy-e2e/start-e2e-environment.sh
+++ b/goofy-client/apps/goofy-e2e/start-e2e-environment.sh
@@ -11,7 +11,11 @@ fi
 echo "Using docker-compose -f ${SCRIPT_DIR}/docker-compose.yml ..."
 echo
 
-docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-mongodb ozg-elastic
+if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ];
+then
+	DOCKER_GATEWAY_HOST=172.17.0.1
+fi
+docker compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-mongodb ozg-usermanager ozg-elastic
 
 echo
 while [[ $(curl -sw '%{http_code}' "http://localhost:9200" | grep -c 200) != 1 ]]
@@ -22,12 +26,12 @@ done
 
 echo
 echo "Starting Pluto to init search index..."
-SPRING_PROFILE=dev,e2e,initSearchIndex docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up ozg-pluto
+SPRING_PROFILE=dev,e2e,initSearchIndex docker compose -f ${SCRIPT_DIR}/docker-compose.yml up ozg-pluto
 
 echo
 echo "Starting Pluto and Goofy for normal operations..."
-SPRING_PROFILE=dev,e2e docker-compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-pluto ozg-goofy ozg-usermanager
+SPRING_PROFILE=dev,e2e docker compose -f ${SCRIPT_DIR}/docker-compose.yml up -d ozg-pluto ozg-goofy ozg-usermanager
 
 echo
 echo "Checking Docker Log for \"Started\" lines..."
-docker-compose -f ${SCRIPT_DIR}/docker-compose.yml logs -f | egrep "(Starting|Started)"
+docker compose -f ${SCRIPT_DIR}/docker-compose.yml logs -f | egrep "(Starting|Started)"
-- 
GitLab