From d919cd6b387dc104ab7ea46c32c6ed16ff37b615 Mon Sep 17 00:00:00 2001
From: birkon <birkon@stud.ntnu.no>
Date: Fri, 5 May 2023 14:33:30 +0200
Subject: [PATCH] fixed create group test

---
 .../v233/SmartMat/controller/group/GroupControllerTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/test/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupControllerTest.java b/src/test/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupControllerTest.java
index 5450d762..1e704f08 100644
--- a/src/test/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupControllerTest.java
+++ b/src/test/java/ntnu/idatt2016/v233/SmartMat/controller/group/GroupControllerTest.java
@@ -5,6 +5,7 @@ import ntnu.idatt2016.v233.SmartMat.dto.request.group.ChangeAuthorityRequest;
 import ntnu.idatt2016.v233.SmartMat.dto.request.group.GroupConnectionRequest;
 import ntnu.idatt2016.v233.SmartMat.dto.request.group.GroupRequest;
 import ntnu.idatt2016.v233.SmartMat.dto.response.group.GroupDetailsResponse;
+import ntnu.idatt2016.v233.SmartMat.dto.response.group.GroupResponse;
 import ntnu.idatt2016.v233.SmartMat.entity.group.Group;
 import ntnu.idatt2016.v233.SmartMat.entity.group.UserGroupAsso;
 import ntnu.idatt2016.v233.SmartMat.entity.group.UserGroupId;
@@ -299,7 +300,7 @@ public class GroupControllerTest {
 
         assertNotNull(result.getBody());
 
-        assertEquals(group.getGroupId(), ((GroupDetailsResponse) result.getBody()).getGroupId());
+        assertEquals(group.getGroupId(),  ((GroupResponse) result.getBody()).groupId());
 
         verify(groupService, times(1)).createGroup(any(Group.class));
     }
@@ -463,7 +464,7 @@ public class GroupControllerTest {
     void getGroupLevelNotAuthorized(){
         when(groupService.isUserAssociatedWithGroup(regularUser.getName(), group.getGroupId())).thenReturn(false);
 
-        
+
         ResponseEntity<?> groupResponseEntity =
                 groupController.getGroupLevel(group.getGroupId(), regularUser);
 
-- 
GitLab