diff --git a/goofy-server/src/main/java/de/itvsh/goofy/common/user/User.java b/goofy-server/src/main/java/de/itvsh/goofy/common/user/User.java deleted file mode 100644 index 5a2b05da617fbac2fc4fc8fd3f6d821d304bf4ba..0000000000000000000000000000000000000000 --- a/goofy-server/src/main/java/de/itvsh/goofy/common/user/User.java +++ /dev/null @@ -1,12 +0,0 @@ -package de.itvsh.goofy.common.user; - -import lombok.Builder; -import lombok.Getter; - -@Getter -@Builder -public class User { - - private String firstName; - private String lastName; -} diff --git a/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserRemoteService.java b/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserRemoteService.java index 5d9b83095b80752072c285fc8e04f1cdcc6bcb94..bdcb42cc28e7181a3e706bd500cedf85487960aa 100644 --- a/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserRemoteService.java +++ b/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserRemoteService.java @@ -68,7 +68,7 @@ public class UserRemoteService { } } - public Optional<User> getUser(UserId userId) { + public Optional<GoofyUser> getUser(UserId userId) { return executeHandlingException(() -> getUserById(userId)); } @@ -83,7 +83,7 @@ public class UserRemoteService { } } - <T> User getUserById(UserId userId) { + <T> GoofyUser getUserById(UserId userId) { return buildUser(getBodyMap(doExchange(userId))); } @@ -111,8 +111,8 @@ public class UserRemoteService { return (LinkedHashMap<String, Object>) responseEntity.getBody(); } - User buildUser(LinkedHashMap<String, Object> bodyMap) { - return User.builder() + GoofyUser buildUser(LinkedHashMap<String, Object> bodyMap) { + return GoofyUser.builder() .firstName((String) bodyMap.getOrDefault(FIRST_NAME_KEY, StringUtils.EMPTY)) .lastName((String) bodyMap.getOrDefault(LAST_NAME_KEY, StringUtils.EMPTY)) .build(); diff --git a/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserService.java b/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserService.java index 0f7fc3f30000b1160a7119388f1430f0996c32bb..19f64d7ac157a1729bf3ee5a7a59057edecc54ae 100644 --- a/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserService.java +++ b/goofy-server/src/main/java/de/itvsh/goofy/common/user/UserService.java @@ -11,7 +11,7 @@ public class UserService { @Autowired private UserRemoteService remoteService; - public Optional<User> getById(UserId userId) { + public Optional<GoofyUser> getById(UserId userId) { return remoteService.getUser(userId); } } \ No newline at end of file diff --git a/goofy-server/src/test/java/de/itvsh/goofy/JwtTokenUtilTest.java b/goofy-server/src/test/java/de/itvsh/goofy/JwtTokenUtilTest.java index 6af877a4e44cda5955b9df8cd4710cb99cda8252..92a75d932300994bec622d8b8c23c0a774b6d0cd 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/JwtTokenUtilTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/JwtTokenUtilTest.java @@ -45,7 +45,7 @@ import com.auth0.jwt.exceptions.JWTVerificationException; import de.itvsh.goofy.common.binaryfile.FileId; import de.itvsh.goofy.common.downloadtoken.DownloadTokenProperties; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.ZustaendigeStelleTestFactory; import io.jsonwebtoken.Claims; import io.jsonwebtoken.Jwts; @@ -78,7 +78,7 @@ class JwtTokenUtilTest { when(downloadTokenProperties.getSecret()).thenReturn(TOKEN_SECRET); when(downloadTokenProperties.getValidity()).thenReturn(TOKEN_VALIDITY); - generatedToken = jwtTokenUtil.generateToken(FileId.createNew(), GoofyUserTestFactory.create()); + generatedToken = jwtTokenUtil.generateToken(FileId.createNew(), UserProfileTestFactory.create()); } @Test diff --git a/goofy-server/src/test/java/de/itvsh/goofy/RootControllerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/RootControllerTest.java index b36b061a4488777cac1da1dbf5b6ba93bdfa090c..91ce9c7abe759ba19ba850e2394196a9047184f1 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/RootControllerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/RootControllerTest.java @@ -49,7 +49,7 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import de.itvsh.goofy.common.user.CurrentUserService; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.common.user.UserRemoteService; import de.itvsh.goofy.common.user.UserRole; import de.itvsh.goofy.system.SystemStatusService; @@ -81,8 +81,8 @@ class RootControllerTest { void initTest() { mockMvc = MockMvcBuilders.standaloneSetup(controller).build(); - when(currentUserService.getUserId()).thenReturn(GoofyUserTestFactory.ID); - when(internalUserIdService.getUserId(any())).thenReturn(Optional.of(GoofyUserTestFactory.ID)); + when(currentUserService.getUserId()).thenReturn(UserProfileTestFactory.ID); + when(internalUserIdService.getUserId(any())).thenReturn(Optional.of(UserProfileTestFactory.ID)); ReflectionTestUtils.setField(controller, "userSearchTemplate", SEARCH_BY); ReflectionTestUtils.setField(controller, "userManagerUrl", USERMANAGER_URL); @@ -138,7 +138,7 @@ class RootControllerTest { var model = controller.getRootResource(); assertThat(model.getLink(RootController.REL_MY_VORGAENGE)).isPresent().get().extracting(Link::getHref) - .isEqualTo("/api/vorgangs?page=0&assignedTo=" + GoofyUserTestFactory.ID.toString() + "{&searchBy,limit}"); + .isEqualTo("/api/vorgangs?page=0&assignedTo=" + UserProfileTestFactory.ID.toString() + "{&searchBy,limit}"); } @Test @@ -146,7 +146,7 @@ class RootControllerTest { var model = controller.getRootResource(); assertThat(model.getLink(RootController.REL_SEARCH_MY_VORGAENGE)).isPresent().get().extracting(Link::getHref) - .isEqualTo("/api/vorgangs?page=0&assignedTo=" + GoofyUserTestFactory.ID.toString() + "{&searchBy,limit}"); + .isEqualTo("/api/vorgangs?page=0&assignedTo=" + UserProfileTestFactory.ID.toString() + "{&searchBy,limit}"); } @Test @@ -178,7 +178,7 @@ class RootControllerTest { var model = controller.getRootResource(); assertThat(model.getLink(RootController.REL_MY_VORGAENGE)).isPresent().get().extracting(Link::getHref) - .isEqualTo("/api/vorgangs?page=0&assignedTo=" + GoofyUserTestFactory.ID.toString() + "{&searchBy,limit}"); + .isEqualTo("/api/vorgangs?page=0&assignedTo=" + UserProfileTestFactory.ID.toString() + "{&searchBy,limit}"); } @Test @@ -256,12 +256,12 @@ class RootControllerTest { @Test void shouldHaveCurrentUserLink() { when(controller.getUserProfilesUrl()).thenReturn(Optional.of(USERMANAGER_URL + API_USER_PROFILES_TEMLPATE)); - when(currentUserService.getUserId()).thenReturn(GoofyUserTestFactory.ID); + when(currentUserService.getUserId()).thenReturn(UserProfileTestFactory.ID); var model = controller.getRootResource(); assertThat(model.getLink(RootController.REL_CURRENT_USER)).isPresent().get().extracting(Link::getHref) - .isEqualTo(Link.of(USERMANAGER_URL + API_USER_PROFILES + GoofyUserTestFactory.ID, RootController.REL_CURRENT_USER) + .isEqualTo(Link.of(USERMANAGER_URL + API_USER_PROFILES + UserProfileTestFactory.ID, RootController.REL_CURRENT_USER) .getHref()); } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/SecurityTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/SecurityTestFactory.java index d576b1cc320b904fb5aa5a27225391bf27fb1c46..dabbacc63d6161fd0e559a3071d9882d62e88069 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/SecurityTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/SecurityTestFactory.java @@ -29,11 +29,11 @@ import java.util.List; import org.springframework.security.core.authority.SimpleGrantedAuthority; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; public class SecurityTestFactory { - static final String SUBJECT = GoofyUserTestFactory.ID.toString(); + static final String SUBJECT = UserProfileTestFactory.ID.toString(); static final String USER_FIRSTNAME = "Tim"; static final String USER_LASTNAME = "Tester"; static final String ROLE = "Testrolle"; diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceDeserializerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceDeserializerTest.java index 24fd4afc8d411413e99393a4c3977db4a4e73eec..4fbc567d388ed16852209ab7d298d26a31482aa1 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceDeserializerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceDeserializerTest.java @@ -35,10 +35,10 @@ import com.fasterxml.jackson.core.exc.StreamReadException; import com.fasterxml.jackson.databind.DatabindException; import com.fasterxml.jackson.databind.ObjectMapper; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class LinkedResourceDeserializerTest { - private static final String TEST_JSON = "{\"id\":\"/api/vorgangs/" + GoofyUserTestFactory.ID.toString() + "\"}"; + private static final String TEST_JSON = "{\"id\":\"/api/vorgangs/" + UserProfileTestFactory.ID.toString() + "\"}"; @DisplayName("Test the deserilization of linked resource json") @Nested @@ -47,7 +47,7 @@ class LinkedResourceDeserializerTest { void shouldDeserialize() throws StreamReadException, DatabindException, IOException { LinkedResourceTestObject res = new ObjectMapper().readValue(TEST_JSON.getBytes(), LinkedResourceTestObject.class); - assertThat(res).hasFieldOrPropertyWithValue("id", GoofyUserTestFactory.ID); + assertThat(res).hasFieldOrPropertyWithValue("id", UserProfileTestFactory.ID); } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceSerializerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceSerializerTest.java index 583649f91327336e948d14d5d4a548bd339b9fb0..82d1e5939f290dd9af69860dd594d925a7110fa7 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceSerializerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedResourceSerializerTest.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class LinkedResourceSerializerTest { @@ -41,11 +41,11 @@ class LinkedResourceSerializerTest { class TestSerialization { @Test void shouldSerialize() throws JsonProcessingException { - var testObj = new LinkedResourceTestObject(GoofyUserTestFactory.ID); + var testObj = new LinkedResourceTestObject(UserProfileTestFactory.ID); String serialized = new ObjectMapper().writeValueAsString(testObj); - assertThat(serialized).isEqualTo("{\"id\":\"/api/vorgangs/" + GoofyUserTestFactory.ID.toString() + "\"}"); + assertThat(serialized).isEqualTo("{\"id\":\"/api/vorgangs/" + UserProfileTestFactory.ID.toString() + "\"}"); } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceDeserializerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceDeserializerTest.java index 1d276ea2ac09c8cfca032f87c949d03cc9497748..2ac3952751a60947a4ecc4eb44595934d4a87a7e 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceDeserializerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceDeserializerTest.java @@ -35,10 +35,10 @@ import com.fasterxml.jackson.core.exc.StreamReadException; import com.fasterxml.jackson.databind.DatabindException; import com.fasterxml.jackson.databind.ObjectMapper; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class LinkedUserProfileResourceDeserializerTest { - private static final String TEST_JSON = "{\"id\":\"http://localhost/api/profile/" + GoofyUserTestFactory.ID.toString() + "\"}"; + private static final String TEST_JSON = "{\"id\":\"http://localhost/api/profile/" + UserProfileTestFactory.ID.toString() + "\"}"; @DisplayName("Test the deserilization of linked resource json") @Nested @@ -47,7 +47,7 @@ class LinkedUserProfileResourceDeserializerTest { void shouldDeserialize() throws StreamReadException, DatabindException, IOException { LinkedUserProfileResourceTestObject res = new ObjectMapper().readValue(TEST_JSON.getBytes(), LinkedUserProfileResourceTestObject.class); - assertThat(res).hasFieldOrPropertyWithValue("id", GoofyUserTestFactory.ID); + assertThat(res).hasFieldOrPropertyWithValue("id", UserProfileTestFactory.ID); } } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceSerializerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceSerializerTest.java index 329b51f4f537ec54516b3ef7caae41ab9474a9aa..ec0f071f36690e3a38dde89d2825df311319ad6b 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceSerializerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/LinkedUserProfileResourceSerializerTest.java @@ -36,7 +36,7 @@ import org.springframework.core.env.Environment; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class LinkedUserProfileResourceSerializerTest { @DisplayName("Test the json serilization of linked user profile resource annotations") @@ -60,11 +60,11 @@ class LinkedUserProfileResourceSerializerTest { when(context.getEnvironment()).thenReturn(env); provider.setApplicationContext(context); - var testObj = new LinkedUserProfileResourceTestObject(GoofyUserTestFactory.ID); + var testObj = new LinkedUserProfileResourceTestObject(UserProfileTestFactory.ID); String serialized = new ObjectMapper().writeValueAsString(testObj); - assertThat(serialized).isEqualTo("{\"id\":\"" + HTTP_LOCALHOST + API_PATH + GoofyUserTestFactory.ID.toString() + "\"}"); + assertThat(serialized).isEqualTo("{\"id\":\"" + HTTP_LOCALHOST + API_PATH + UserProfileTestFactory.ID.toString() + "\"}"); } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/BinaryFileControllerITCase.java b/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/BinaryFileControllerITCase.java index 24472d08d8e38244ffefed3efa7ae301e9d36ea2..3db4f520879715d0c6b8cb40bd84863f7223e17a 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/BinaryFileControllerITCase.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/BinaryFileControllerITCase.java @@ -52,7 +52,7 @@ import de.itvsh.goofy.common.downloadtoken.DownloadTokenController; import de.itvsh.goofy.common.downloadtoken.DownloadTokenProperties; import de.itvsh.goofy.common.downloadtoken.DownloadTokenTestFactory; import de.itvsh.goofy.common.file.OzgFileTestFactory; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import io.jsonwebtoken.JwtBuilder; @AutoConfigureMockMvc @@ -105,8 +105,8 @@ class BinaryFileControllerITCase { private Map<String, Object> createClaims(FileId fileId) { return new HashMap<>(Map.of( - FIRSTNAME_CLAIM, GoofyUserTestFactory.FIRSTNAME, - LASTNAME_CLAIM, GoofyUserTestFactory.LASTNAME, + FIRSTNAME_CLAIM, UserProfileTestFactory.FIRSTNAME, + LASTNAME_CLAIM, UserProfileTestFactory.LASTNAME, ROLE_CLAIM, List.of(), FILEID_CLAIM, fileId.toString())); } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/DownloadGoofyUserTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/DownloadGoofyUserTestFactory.java index 8521a24f119e11241ffd9400fd5376696d43745b..5b13b74510dbd84f70686b683133b99af7105f5d 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/DownloadGoofyUserTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/binaryfile/DownloadGoofyUserTestFactory.java @@ -23,7 +23,7 @@ */ package de.itvsh.goofy.common.binaryfile; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; public class DownloadGoofyUserTestFactory { @@ -32,6 +32,6 @@ public class DownloadGoofyUserTestFactory { } static GoofyUserWithFileId.GoofyUserWithFileIdBuilder createBuilder() { - return GoofyUserWithFileId.builder().user(GoofyUserTestFactory.create()).fileId(BinaryFileTestFactory.FILE_ID); + return GoofyUserWithFileId.builder().user(UserProfileTestFactory.create()).fileId(BinaryFileTestFactory.FILE_ID); } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/CallContextTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/CallContextTestFactory.java index 3e43bb6ac28663c075e12f929227ddf29b86bd38..c20bb0a856114a34c80f9d615b1ee923a971b471 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/CallContextTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/CallContextTestFactory.java @@ -27,7 +27,7 @@ import static de.itvsh.goofy.common.callcontext.ContextService.*; import java.util.Map; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; public class CallContextTestFactory { @@ -35,8 +35,8 @@ public class CallContextTestFactory { static Map<String, String> createContextMap() { return Map.of( - KEY_USER_ID, GoofyUserTestFactory.ID.toString(), - KEY_USER_NAME, GoofyUserTestFactory.FULLNAME); + KEY_USER_ID, UserProfileTestFactory.ID.toString(), + KEY_USER_NAME, UserProfileTestFactory.FULLNAME); } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/ContextServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/ContextServiceTest.java index 22c4f0eff8ca7622568f130ea4b23f26dfc3bd26..b31cfa1726d4be392982c17639c2ac5fdce5a1fa 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/ContextServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/callcontext/ContextServiceTest.java @@ -45,7 +45,7 @@ import de.itvsh.goofy.RequestAttributes; import de.itvsh.goofy.RequestAttributesTestFactory; import de.itvsh.goofy.common.GrpcUtil; import de.itvsh.goofy.common.user.CurrentUserService; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.common.user.UserRole; import de.itvsh.goofy.vorgang.ZustaendigeStelleTestFactory; import de.itvsh.ozg.pluto.grpc.command.GrpcUser; @@ -67,7 +67,7 @@ class ContextServiceTest { @BeforeEach void initMocks() { when(context.getId()).thenReturn(APPLICATION_ID); - when(userService.getUser()).thenReturn(GoofyUserTestFactory.create()); + when(userService.getUser()).thenReturn(UserProfileTestFactory.create()); } @DisplayName("Get context metas") @@ -83,14 +83,14 @@ class ContextServiceTest { void shouldHaveUserId() { var metadata = service.buildCallContextMetadata(); - assertThat(GrpcUtil.getFromHeaders(KEY_USER_ID, metadata)).isEqualTo(GoofyUserTestFactory.ID.toString()); + assertThat(GrpcUtil.getFromHeaders(KEY_USER_ID, metadata)).isEqualTo(UserProfileTestFactory.ID.toString()); } @Test void shouldHaveUserName() { var metadata = service.buildCallContextMetadata(); - assertThat(GrpcUtil.getFromHeaders(KEY_USER_NAME, metadata)).isEqualTo(GoofyUserTestFactory.FULLNAME); + assertThat(GrpcUtil.getFromHeaders(KEY_USER_NAME, metadata)).isEqualTo(UserProfileTestFactory.FULLNAME); } @Test @@ -171,14 +171,14 @@ class ContextServiceTest { void shoultHaveUserId() { var context = service.createCallContext(); - assertThat(context.getUser()).extracting(GrpcUser::getId).isEqualTo(GoofyUserTestFactory.ID.toString()); + assertThat(context.getUser()).extracting(GrpcUser::getId).isEqualTo(UserProfileTestFactory.ID.toString()); } @Test void shouldHaveFullName() { var context = service.createCallContext(); - assertThat(context.getUser()).extracting(GrpcUser::getName).isEqualTo(GoofyUserTestFactory.FULLNAME); + assertThat(context.getUser()).extracting(GrpcUser::getName).isEqualTo(UserProfileTestFactory.FULLNAME); } @Test diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandITCase.java b/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandITCase.java index 44db1784ce63bc61eaeb30de8fffed46647f0371..402a9c75ecdfb984312fcfdbc4418cdaf35fa621 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandITCase.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandITCase.java @@ -47,7 +47,7 @@ import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import de.itvsh.goofy.common.ValidationMessageCodes; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.postfach.PostfachMailTestFactory; import de.itvsh.goofy.vorgang.RedirectRequestTestFactory; import de.itvsh.goofy.vorgang.VorgangController; @@ -84,7 +84,7 @@ public class CommandITCase { createCommand(); verify(commandRemoteService).createCommand(commandCaptor.capture()); - assertThat(commandCaptor.getValue().getBody()).hasFieldOrPropertyWithValue("assignedTo", GoofyUserTestFactory.ID); + assertThat(commandCaptor.getValue().getBody()).hasFieldOrPropertyWithValue("assignedTo", UserProfileTestFactory.ID); } private void createCommand() throws Exception { @@ -95,7 +95,7 @@ public class CommandITCase { private String createContent() { return TestUtils.loadTextFile("jsonTemplates/command/createCommandWithBody.json.tmpl", CommandOrder.ASSIGN_USER.name(), TestUtils.loadTextFile("jsonTemplates/command/commandAssignedToBody", - TestUtils.addQuote("/api/users/" + GoofyUserTestFactory.ID.toString()))); + TestUtils.addQuote("/api/users/" + UserProfileTestFactory.ID.toString()))); } private String buildUrl() { diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandTestFactory.java index b79a664658188696624e8f09cd520affe9738ef4..d77c2ec82c55a316cf20cfcb744a7179386a762b 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/command/CommandTestFactory.java @@ -25,7 +25,7 @@ package de.itvsh.goofy.common.command; import java.util.UUID; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; import de.itvsh.goofy.vorgang.forwarding.ForwardingTestFactory; @@ -50,7 +50,7 @@ public class CommandTestFactory { .relationId(RELATION_ID) .status(STATUS) .order(ORDER) - .createdBy(GoofyUserTestFactory.ID); + .createdBy(UserProfileTestFactory.ID); } public static CreateCommand createCreateCommand() { diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenServiceTest.java index 6c3bbec6965b187fa85c0d1f56abc0c6ffcf6bf6..780c244e10df6314437b71f5a34a8aa74f58eec5 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenServiceTest.java @@ -48,7 +48,7 @@ import de.itvsh.goofy.JwtTokenUtil; import de.itvsh.goofy.common.binaryfile.FileId; import de.itvsh.goofy.common.user.CurrentUserService; import de.itvsh.goofy.common.user.GoofyUser; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.kop.common.errorhandling.TechnicalException; import io.jsonwebtoken.Claims; @@ -73,7 +73,7 @@ class DownloadTokenServiceTest { final FileId fileId = FileId.createNew(); - final GoofyUser user = GoofyUserTestFactory.create(); + final GoofyUser user = UserProfileTestFactory.create(); @BeforeEach void mockUserService() { @@ -139,7 +139,7 @@ class DownloadTokenServiceTest { when(claims.get(FIRSTNAME_CLAIM, String.class)).thenReturn(firstnameClaim); when(claims.get(LASTNAME_CLAIM, String.class)).thenReturn(lastnameClaim); - when(claims.get(USERID_CLAIM, String.class)).thenReturn(GoofyUserTestFactory.ID.toString()); + when(claims.get(USERID_CLAIM, String.class)).thenReturn(UserProfileTestFactory.ID.toString()); when(jwtTokenUtil.getOrganisationseinheitIdsFromToken(any())).thenReturn(ORGE_IDS); when(jwtTokenUtil.getAllClaimsFromToken(any())).thenReturn(Optional.of(claims)); diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenTestFactory.java index 0ad785dbe11f10ae2f282e52961c3ed10448dcb0..a359d826e46fa38969410c469a5f3cd5278ff863 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/downloadtoken/DownloadTokenTestFactory.java @@ -31,7 +31,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import io.jsonwebtoken.JwtBuilder; import io.jsonwebtoken.Jwts; import io.jsonwebtoken.SignatureAlgorithm; @@ -39,8 +39,8 @@ import io.jsonwebtoken.SignatureAlgorithm; public class DownloadTokenTestFactory { static final String TYP = "typ"; static final String SUBJECT = "subject"; - static final String FIRSTNAME_CLAIM_VALUE = GoofyUserTestFactory.FIRSTNAME; - static final String LASTNAME_CLAIM_VALUE = GoofyUserTestFactory.LASTNAME; + static final String FIRSTNAME_CLAIM_VALUE = UserProfileTestFactory.FIRSTNAME; + static final String LASTNAME_CLAIM_VALUE = UserProfileTestFactory.LASTNAME; final static Collection<String> ORGE_IDS = List.of("258994"); static final List<?> ROLE_CLAIM_VALUE = List.of(); static final long VALIDITY = 5000; diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/user/GrpcUserTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/user/GrpcUserTestFactory.java index 494114110a3b8f87eae2229cb6ad585b12cb19e8..d4aa272f6699fc73f3595545e4ebce88dcbd44f3 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/user/GrpcUserTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/user/GrpcUserTestFactory.java @@ -31,8 +31,8 @@ import de.itvsh.ozg.pluto.grpc.command.GrpcUser; public class GrpcUserTestFactory { public static final String ID = UUID.randomUUID().toString(); - public static final String NAME = GoofyUserTestFactory.FULLNAME; - public static final String ROLE = GoofyUserTestFactory.ROLE; + public static final String NAME = UserProfileTestFactory.FULLNAME; + public static final String ROLE = UserProfileTestFactory.ROLE; public static GrpcUser create() { return createBuilder().build(); diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/user/GoofyUserTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserProfileTestFactory.java similarity index 98% rename from goofy-server/src/test/java/de/itvsh/goofy/common/user/GoofyUserTestFactory.java rename to goofy-server/src/test/java/de/itvsh/goofy/common/user/UserProfileTestFactory.java index 8e4c9d70102061c86346d869120eacb30e5b1cbe..4e31f6e68ae2caf2eaffaf40798bcdbbe9b134c2 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/user/GoofyUserTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserProfileTestFactory.java @@ -31,7 +31,7 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority; import de.itvsh.goofy.vorgang.ZustaendigeStelleTestFactory; -public class GoofyUserTestFactory { +public class UserProfileTestFactory { public static final UserId ID = UserId.from(UUID.randomUUID().toString()); public static final String FIRSTNAME = "Vaneßa"; diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserRemoteServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserRemoteServiceTest.java index 66d93815bd3cdfe6d94488b67469df313d2de923..351852b2cc46eb1075512abc7a9772859386b97a 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserRemoteServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserRemoteServiceTest.java @@ -76,14 +76,14 @@ class UserRemoteServiceTest { @BeforeEach void mock() { - when(restTemplate.getForObject(anyString(), eq(String.class), anyString())).thenReturn(GoofyUserTestFactory.ID.toString()); + when(restTemplate.getForObject(anyString(), eq(String.class), anyString())).thenReturn(UserProfileTestFactory.ID.toString()); } @Test void shouldReturnResponseAsUserId() { - var userId = service.getUserId(GoofyUserTestFactory.ID); + var userId = service.getUserId(UserProfileTestFactory.ID); - assertThat(userId).hasValue(GoofyUserTestFactory.ID); + assertThat(userId).hasValue(UserProfileTestFactory.ID); } } @@ -95,7 +95,7 @@ class UserRemoteServiceTest { void shouldHandleEmptyValue() { when(restTemplate.getForObject(anyString(), eq(String.class), anyString())).thenReturn(""); - var res = service.getUserId(GoofyUserTestFactory.ID); + var res = service.getUserId(UserProfileTestFactory.ID); assertThat(res).isNotPresent(); } @@ -104,7 +104,7 @@ class UserRemoteServiceTest { void shouldHandleError() { when(restTemplate.getForObject(anyString(), eq(String.class), anyString())).thenThrow(new RestClientException("Test error")); - var res = service.getUserId(GoofyUserTestFactory.ID); + var res = service.getUserId(UserProfileTestFactory.ID); assertThat(res).isNotPresent(); } @@ -115,7 +115,7 @@ class UserRemoteServiceTest { @Nested class TestGetUser { - private final String profileUri = "DummyProfileTemplate/" + GoofyUserTestFactory.ID; + private final String profileUri = "DummyProfileTemplate/" + UserProfileTestFactory.ID; private final String dummyToken = "Token"; @BeforeEach @@ -128,8 +128,8 @@ class UserRemoteServiceTest { @Nested class TestOnValidResponse { - private final Map<String, Object> bodyMap = new LinkedHashMap<>(Map.of(UserRemoteService.FIRST_NAME_KEY, GoofyUserTestFactory.FIRSTNAME, - UserRemoteService.LAST_NAME_KEY, GoofyUserTestFactory.LASTNAME)); + private final Map<String, Object> bodyMap = new LinkedHashMap<>(Map.of(UserRemoteService.FIRST_NAME_KEY, UserProfileTestFactory.FIRSTNAME, + UserRemoteService.LAST_NAME_KEY, UserProfileTestFactory.LASTNAME)); private final ResponseEntity<Object> response = new ResponseEntity<>(bodyMap, HttpStatus.OK); @BeforeEach @@ -143,25 +143,25 @@ class UserRemoteServiceTest { headers.add("Authorization", "Bearer " + dummyToken); var httpEntity = new HttpEntity<>(headers); - service.getUser(GoofyUserTestFactory.ID); + service.getUser(UserProfileTestFactory.ID); verify(restTemplate).exchange(profileUri, HttpMethod.GET, httpEntity, Object.class); } @Test void shouldBuildUrl() { - service.getUser(GoofyUserTestFactory.ID); + service.getUser(UserProfileTestFactory.ID); - verify(service).buildUserProfileUri(GoofyUserTestFactory.ID); + verify(service).buildUserProfileUri(UserProfileTestFactory.ID); } @Test void shouldReturnUser() { - var loadedUser = service.getUser(GoofyUserTestFactory.ID); + var loadedUser = service.getUser(UserProfileTestFactory.ID); assertThat(loadedUser).isPresent(); - assertThat(loadedUser.get().getFirstName()).isEqualTo(GoofyUserTestFactory.FIRSTNAME); - assertThat(loadedUser.get().getLastName()).isEqualTo(GoofyUserTestFactory.LASTNAME); + assertThat(loadedUser.get().getFirstName()).isEqualTo(UserProfileTestFactory.FIRSTNAME); + assertThat(loadedUser.get().getLastName()).isEqualTo(UserProfileTestFactory.LASTNAME); } } @@ -178,7 +178,7 @@ class UserRemoteServiceTest { void shouldThrowServiceUnavailablExceptionOnException() { when(restTemplate.exchange(anyString(), eq(HttpMethod.GET), any(), eq(Object.class))).thenThrow(serviceUnavailableException); - assertThatThrownBy(() -> service.getUser(GoofyUserTestFactory.ID)).isInstanceOf(ServiceUnavailableException.class) + assertThatThrownBy(() -> service.getUser(UserProfileTestFactory.ID)).isInstanceOf(ServiceUnavailableException.class) .hasCause(serviceUnavailableException); } @@ -186,7 +186,7 @@ class UserRemoteServiceTest { void shouldReturnEmptyOptionalOnNotFoundException() { when(restTemplate.exchange(anyString(), eq(HttpMethod.GET), any(), eq(Object.class))).thenThrow(notFoundException); - var user = service.getUser(GoofyUserTestFactory.ID); + var user = service.getUser(UserProfileTestFactory.ID); assertThat(user).isEmpty(); } @@ -206,16 +206,16 @@ class UserRemoteServiceTest { @Test void shouldCallUserManagerProperties() { - service.buildUserProfileUri(GoofyUserTestFactory.ID); + service.buildUserProfileUri(UserProfileTestFactory.ID); verify(userManagerProperties).getProfileTemplate(); } @Test void shouldReturnUserProfileUri() { - var uri = service.buildUserProfileUri(GoofyUserTestFactory.ID); + var uri = service.buildUserProfileUri(UserProfileTestFactory.ID); - assertThat(uri).isEqualTo("DummyProfileTemplate/" + GoofyUserTestFactory.ID); + assertThat(uri).isEqualTo("DummyProfileTemplate/" + UserProfileTestFactory.ID); } } } \ No newline at end of file diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserServiceTest.java index 7c416c785e9728db53e82ac75db995ff0833c4ac..1bcdbb699ad93b289962709bf0211a3269c61a4d 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserServiceTest.java @@ -21,9 +21,9 @@ class UserServiceTest { @Test void shouldCallRemoteService() { - service.getById(GoofyUserTestFactory.ID); + service.getById(UserProfileTestFactory.ID); - verify(remoteService).getUser(GoofyUserTestFactory.ID); + verify(remoteService).getUser(UserProfileTestFactory.ID); } } } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserTestFactory.java deleted file mode 100644 index 64fdfdfee06c37d7b502dbf7c9c32fa3340850b9..0000000000000000000000000000000000000000 --- a/goofy-server/src/test/java/de/itvsh/goofy/common/user/UserTestFactory.java +++ /dev/null @@ -1,14 +0,0 @@ -package de.itvsh.goofy.common.user; - -public class UserTestFactory { - - public static User create() { - return createBuilder().build(); - } - - public static User.UserBuilder createBuilder() { - return User.builder() - .firstName(GoofyUserTestFactory.FIRSTNAME) - .lastName(GoofyUserTestFactory.LASTNAME); - } -} \ No newline at end of file diff --git a/goofy-server/src/test/java/de/itvsh/goofy/historie/HistorieModelAssemblerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/historie/HistorieModelAssemblerTest.java index d3cf4c45d36c720c6bcf79530e070350c7e416c2..1523f4350bf6a955a7dba3c3877a994836135920 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/historie/HistorieModelAssemblerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/historie/HistorieModelAssemblerTest.java @@ -40,7 +40,7 @@ import org.springframework.test.util.ReflectionTestUtils; import de.itvsh.goofy.common.UserProfileUrlProvider; import de.itvsh.goofy.common.command.CommandTestFactory; import de.itvsh.goofy.common.user.UserId; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class HistorieModelAssemblerTest { private static final String CREATED_BY = "createdBy"; @@ -74,10 +74,10 @@ class HistorieModelAssemblerTest { void shouldBePresentOnExistingValue() { var model = modelAssembler.toModel(CommandTestFactory.createBuilder() - .body(Map.of(HistorieModelAssembler.ASSIGNED_TO_BODY_FIELD, GoofyUserTestFactory.ID)).build()); + .body(Map.of(HistorieModelAssembler.ASSIGNED_TO_BODY_FIELD, UserProfileTestFactory.ID)).build()); assertThat(model.getLink(HistorieModelAssembler.REL_ASSIGNED_TO)).isPresent().get().extracting(Link::getHref) - .isEqualTo(ROOT_URL + USER_PROFILES_API_PATH + GoofyUserTestFactory.ID); + .isEqualTo(ROOT_URL + USER_PROFILES_API_PATH + UserProfileTestFactory.ID); } @Test @@ -99,7 +99,7 @@ class HistorieModelAssemblerTest { var model = modelAssembler.toModel(CommandTestFactory.create()); assertThat(model.getLink(CREATED_BY)).isPresent().get().extracting(Link::getHref) - .isEqualTo(ROOT_URL + USER_PROFILES_API_PATH + GoofyUserTestFactory.ID); + .isEqualTo(ROOT_URL + USER_PROFILES_API_PATH + UserProfileTestFactory.ID); } @Test diff --git a/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarServiceTest.java index 8c258f2ae26300c3cc0b78551e3ab53973e539a8..d0d7d3f020820329e61013df0148052d5df0ee3c 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarServiceTest.java @@ -45,7 +45,7 @@ import de.itvsh.goofy.common.attacheditem.VorgangAttachedItemService; import de.itvsh.goofy.common.command.Command; import de.itvsh.goofy.common.command.CommandTestFactory; import de.itvsh.goofy.common.user.CurrentUserService; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; class KommentarServiceTest { @@ -97,7 +97,7 @@ class KommentarServiceTest { @BeforeEach void mockServices() { - when(currentUserService.getUserId()).thenReturn(GoofyUserTestFactory.ID); + when(currentUserService.getUserId()).thenReturn(UserProfileTestFactory.ID); } @Test @@ -111,7 +111,7 @@ class KommentarServiceTest { void shouldSetCreatedBy() throws Exception { var kommentar = callAddCreated(); - assertThat(kommentar.getCreatedBy()).isEqualTo(GoofyUserTestFactory.ID.toString()); + assertThat(kommentar.getCreatedBy()).isEqualTo(UserProfileTestFactory.ID.toString()); } private Kommentar callAddCreated() { diff --git a/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarTestFactory.java index 94b73c1c7778bfd828c26e50bd255d9e0e710a62..7fb92bf4d98526faf1833bc3185f91e82e399ce3 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/kommentar/KommentarTestFactory.java @@ -30,7 +30,7 @@ import java.util.UUID; import com.thedeanda.lorem.Lorem; import com.thedeanda.lorem.LoremIpsum; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; public class KommentarTestFactory { @@ -40,7 +40,7 @@ public class KommentarTestFactory { public static final String ID = UUID.randomUUID().toString(); public static final long VERSION = 73; - public static final String CREATED_BY = GoofyUserTestFactory.ID.toString(); + public static final String CREATED_BY = UserProfileTestFactory.ID.toString(); public static final String CREATED_AT_STR = "2021-01-10T10:30:00Z"; public static final ZonedDateTime CREATED_AT = ZonedDateTime.parse(CREATED_AT_STR); diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java index c3f2ac01544f080ad923a0bd00449c4951f6e002..05d403ffe815c2af53a3730516c253dbc0bae049 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailServiceTest.java @@ -48,10 +48,9 @@ import de.itvsh.goofy.common.command.CommandTestFactory; import de.itvsh.goofy.common.errorhandling.ResourceNotFoundException; import de.itvsh.goofy.common.file.OzgFile; import de.itvsh.goofy.common.file.OzgFileTestFactory; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; import de.itvsh.goofy.common.user.UserId; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.common.user.UserService; -import de.itvsh.goofy.common.user.UserTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; import de.itvsh.goofy.vorgang.VorgangWithEingang; import de.itvsh.goofy.vorgang.VorgangWithEingangTestFactory; @@ -239,14 +238,14 @@ class PostfachMailServiceTest { @BeforeEach void mock() { - doReturn(GoofyUserTestFactory.FULLNAME).when(service).getUserName(any(UserId.class)); + doReturn(UserProfileTestFactory.FULLNAME).when(service).getUserName(any(UserId.class)); } @Test void shouldCallGetUserName() { buildPostfachNachrichtPdfData(); - verify(service).getUserName(GoofyUserTestFactory.ID); + verify(service).getUserName(UserProfileTestFactory.ID); } @Test @@ -260,7 +259,7 @@ class PostfachMailServiceTest { void shouldHaveSetCreatedByName() { var postfachNachricht = buildPostfachNachrichtPdfData(); - assertThat(postfachNachricht.getCreatedByName()).isEqualTo(GoofyUserTestFactory.FULLNAME); + assertThat(postfachNachricht.getCreatedByName()).isEqualTo(UserProfileTestFactory.FULLNAME); } @Test @@ -315,25 +314,25 @@ class PostfachMailServiceTest { @Test void shouldCallUserService() { - service.getUserName(GoofyUserTestFactory.ID); + service.getUserName(UserProfileTestFactory.ID); - verify(userService).getById(GoofyUserTestFactory.ID); + verify(userService).getById(UserProfileTestFactory.ID); } @Test void shouldReturnFullNameIfNotNull() { - when(userService.getById(any(UserId.class))).thenReturn(Optional.of(UserTestFactory.create())); + when(userService.getById(any(UserId.class))).thenReturn(Optional.of(UserProfileTestFactory.create())); - var userName = service.getUserName(GoofyUserTestFactory.ID); + var userName = service.getUserName(UserProfileTestFactory.ID); - assertThat(userName).isEqualTo(GoofyUserTestFactory.FIRSTNAME + " " + GoofyUserTestFactory.LASTNAME); + assertThat(userName).isEqualTo(UserProfileTestFactory.FIRSTNAME + " " + UserProfileTestFactory.LASTNAME); } @Test void shouldReturnFallbackNameOnNull() { when(userService.getById(any(UserId.class))).thenReturn(Optional.empty()); - var userName = service.getUserName(GoofyUserTestFactory.ID); + var userName = service.getUserName(UserProfileTestFactory.ID); assertThat(userName).isEqualTo(PostfachMailService.FALLBACK_USER_NAME); } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailTestFactory.java index 06a7d47d036bb49ec719c8933f007e0fd455314c..067f3f49766abfaf915b037a3d02dd7a77f3c07e 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachMailTestFactory.java @@ -35,7 +35,7 @@ import de.itvsh.goofy.common.binaryfile.BinaryFileTestFactory; import de.itvsh.goofy.common.binaryfile.FileId; import de.itvsh.goofy.common.command.CommandOrder; import de.itvsh.goofy.common.user.UserId; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.postfach.PostfachMail.Direction; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; import de.itvsh.kop.common.test.TestUtils; @@ -48,7 +48,7 @@ public class PostfachMailTestFactory { public static final String POSTFACH_ID = UUID.randomUUID().toString(); public static final String CREATED_AT_STR = "2000-01-01T01:00:00Z"; public static final ZonedDateTime CREATED_AT = ZonedDateTime.parse(CREATED_AT_STR); - public static final UserId CREATED_BY = GoofyUserTestFactory.ID; + public static final UserId CREATED_BY = UserProfileTestFactory.ID; public static final Direction DIRECTION = Direction.OUT; public static final String RECEIVER = LoremIpsum.getInstance().getEmail(); public static final String SUBJECT = RandomStringUtils.randomAlphanumeric(70); diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfDataTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfDataTestFactory.java index f87b30b052be154a2e75871f24d294fe431a3341..c19485c2e753cafcbb34ede5df76e1e0c2653405 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfDataTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtPdfDataTestFactory.java @@ -3,7 +3,7 @@ package de.itvsh.goofy.postfach; import java.util.List; import de.itvsh.goofy.common.binaryfile.BinaryFileTestFactory; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; public class PostfachNachrichtPdfDataTestFactory { @@ -14,7 +14,7 @@ public class PostfachNachrichtPdfDataTestFactory { public static PostfachNachrichtPdfData.PostfachNachrichtPdfDataBuilder createBuilder() { return PostfachNachrichtPdfData.builder() .createdAt(PostfachMailTestFactory.CREATED_AT) - .createdByName(GoofyUserTestFactory.FULLNAME) + .createdByName(UserProfileTestFactory.FULLNAME) .subject(PostfachMailTestFactory.SUBJECT) .mailBody(PostfachMailTestFactory.MAIL_BODY) .attachmentNames(List.of(BinaryFileTestFactory.NAME)); diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java index 8240955221694e717ef17104ac80d9dcdbaf58c3..de548ce1ac2508b97074fb1cf8aa6196f0453f13 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceITCase.java @@ -44,8 +44,8 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import de.itvsh.goofy.common.user.UserId; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.common.user.UserRemoteService; -import de.itvsh.goofy.common.user.UserTestFactory; import de.itvsh.goofy.vorgang.EingangTestFactory; import de.itvsh.goofy.vorgang.VorgangWithEingang; import de.itvsh.goofy.vorgang.VorgangWithEingangTestFactory; @@ -65,7 +65,7 @@ class PostfachNachrichtenPdfServiceITCase { @BeforeEach void mock() { - when(userRemoteService.getUser(any(UserId.class))).thenReturn(Optional.of(UserTestFactory.create())); + when(userRemoteService.getUser(any(UserId.class))).thenReturn(Optional.of(UserProfileTestFactory.create())); } @SneakyThrows diff --git a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java index 5072306d0311f047b1b278e6b437531d6ff61099..363a0c15236853de8b5bc9b0e5bbb4846e72cc0d 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/postfach/PostfachNachrichtenPdfServiceTest.java @@ -44,7 +44,7 @@ import org.springframework.core.io.Resource; import org.springframework.util.ReflectionUtils; import de.itvsh.goofy.common.binaryfile.BinaryFileTestFactory; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.AntragstellerTestFactory; import de.itvsh.goofy.vorgang.EingangTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; @@ -240,7 +240,7 @@ class PostfachNachrichtenPdfServiceTest { void shouldMapNachrichtCreatedBy() { var nachricht = service.mapPostfachNachricht(PostfachNachrichtPdfDataTestFactory.create()); - assertThat(nachricht.getCreatedBy()).isEqualTo(GoofyUserTestFactory.FULLNAME); + assertThat(nachricht.getCreatedBy()).isEqualTo(UserProfileTestFactory.FULLNAME); } @Test diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/FindVorgaengeRequestCriteriaTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/FindVorgaengeRequestCriteriaTestFactory.java index 25876d5fe5970dcddd18f99e2879589015495b16..2cffb2acbe6c3339ebcfb011e4efa1ea2720ebed 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/FindVorgaengeRequestCriteriaTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/FindVorgaengeRequestCriteriaTestFactory.java @@ -27,7 +27,7 @@ import java.util.Optional; import com.thedeanda.lorem.LoremIpsum; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; public class FindVorgaengeRequestCriteriaTestFactory { @@ -46,6 +46,6 @@ public class FindVorgaengeRequestCriteriaTestFactory { .offset(OFFSET) .searchBy(Optional.of(SEARCH_BY)) .orderBy(ORDER_BY) - .assignedTo(Optional.of(GoofyUserTestFactory.ID)); + .assignedTo(Optional.of(UserProfileTestFactory.ID)); } } \ No newline at end of file diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerITCase.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerITCase.java index b351007bcde72a3069f3c7d35a84486f34194202..6926d66e66a6704f1bff3b0b52877221c28d46bd 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerITCase.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerITCase.java @@ -46,7 +46,7 @@ import org.springframework.test.web.servlet.ResultActions; import de.itvsh.goofy.common.clientattribute.ClientAttributeService; import de.itvsh.goofy.common.command.CommandController; import de.itvsh.goofy.common.errorhandling.ResourceNotFoundException; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.postfach.PostfachMailController; import de.itvsh.goofy.vorgang.forwarding.ForwardingController; import de.itvsh.goofy.wiedervorlage.WiedervorlageTestFactory; @@ -143,7 +143,7 @@ class VorgangControllerITCase { void shouldBePresentIfAssigned() throws Exception { when(remoteService.findVorgangWithEingang(anyString())).thenReturn(VorgangWithEingangTestFactory.create()); - doRequest().andExpect(jsonPath("$._links.assignedTo.href").value("http://localhost:9092/api/userProfiles/" + GoofyUserTestFactory.ID)); + doRequest().andExpect(jsonPath("$._links.assignedTo.href").value("http://localhost:9092/api/userProfiles/" + UserProfileTestFactory.ID)); } @Test diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerTest.java index a123df5e922faa7a22dc44e4c06c7bfb7d3300c4..9d0dceec2de8dd13d837097fca8dd23ce53c28f7 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangControllerTest.java @@ -50,7 +50,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import de.itvsh.goofy.common.UserProfileUrlProvider; import de.itvsh.goofy.common.clientattribute.ClientAttributeService; import de.itvsh.goofy.common.user.UserId; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class VorgangControllerTest { @@ -104,7 +104,7 @@ class VorgangControllerTest { callEndpointWithParamsPageSearchAndLimit(); verify(controller).buildFindVorgaengeRequestCriteria(PAGE, Optional.of("test"), Optional.of(7), - Optional.of(GoofyUserTestFactory.ID)); + Optional.of(UserProfileTestFactory.ID)); } @Test @@ -130,7 +130,7 @@ class VorgangControllerTest { .param(VorgangController.PARAM_PAGE, Integer.toString(PAGE)) .param(VorgangController.PARAM_SEARCH, "test") .param(VorgangController.PARAM_LIMIT, Integer.toString(LIMIT)) - .param(VorgangController.PARAM_ASSIGNED_TO, GoofyUserTestFactory.ID.toString())) + .param(VorgangController.PARAM_ASSIGNED_TO, UserProfileTestFactory.ID.toString())) .andExpect(status().isOk()); } } @@ -141,7 +141,7 @@ class VorgangControllerTest { private final static Integer PAGE = 1; private final static Optional<String> SEARCH_BY = Optional.of("SuchBegriff"); private final static Optional<Integer> LIMIT = Optional.of(5); - private final static Optional<UserId> ASSIGNED_TO = Optional.of(GoofyUserTestFactory.ID); + private final static Optional<UserId> ASSIGNED_TO = Optional.of(UserProfileTestFactory.ID); @Test void shouldHaveSetPage() { diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangHeaderTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangHeaderTestFactory.java index 01565d18f194687b9c4b9f292a67452a9a97ddb9..36b9060f5a3523d607a6300edaae1938db886b2d 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangHeaderTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangHeaderTestFactory.java @@ -28,7 +28,7 @@ import java.util.UUID; import com.thedeanda.lorem.LoremIpsum; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.Vorgang.VorgangStatus; public class VorgangHeaderTestFactory { @@ -55,6 +55,6 @@ public class VorgangHeaderTestFactory { .nummer(NUMMER) .status(STATUS) .createdAt(CREATED_AT) - .assignedTo(GoofyUserTestFactory.ID); + .assignedTo(UserProfileTestFactory.ID); } } \ No newline at end of file diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangITCase.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangITCase.java index ae787029e76dd68744385e2d56cc0553dd9c56a4..efc638ec94b067d5d6ce196cca05279649993fd0 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangITCase.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangITCase.java @@ -44,7 +44,7 @@ import org.springframework.test.web.servlet.ResultActions; import de.itvsh.goofy.common.command.CommandController; import de.itvsh.goofy.common.user.CurrentUserService; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.common.user.UserRole; import de.itvsh.goofy.postfach.PostfachMailController; import de.itvsh.goofy.vorgang.Vorgang.VorgangStatus; @@ -84,7 +84,7 @@ class VorgangITCase { @Test void shouldReturnVorgangOnMatchingOrganisationseinheitId() throws Exception { when(userService.getUser()).thenReturn( - GoofyUserTestFactory.createBuilder().clearOrganisationseinheitIds() + UserProfileTestFactory.createBuilder().clearOrganisationseinheitIds() .organisationseinheitId(ZustaendigeStelleTestFactory.ORGANISATIONSEINHEITEN_ID).build()); doRequest().andExpect(status().isOk()); @@ -92,7 +92,7 @@ class VorgangITCase { @Test void shouldReturnVorgangOnEmptyUserOrganisationseinheitIdList() throws Exception { - when(userService.getUser()).thenReturn(GoofyUserTestFactory.createBuilder().clearOrganisationseinheitIds().build()); + when(userService.getUser()).thenReturn(UserProfileTestFactory.createBuilder().clearOrganisationseinheitIds().build()); doRequest().andExpect(status().isOk()); } diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangModelAssemblerTest.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangModelAssemblerTest.java index cdd94378d6f824e5e43df4256e8ffd2d51f96000..e7cbe0567a9411b9705362c259cd356000dafbf9 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangModelAssemblerTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangModelAssemblerTest.java @@ -46,7 +46,7 @@ import org.springframework.hateoas.Link; import de.itvsh.goofy.common.UserProfileUrlProvider; import de.itvsh.goofy.common.user.CurrentUserService; import de.itvsh.goofy.common.user.UserRole; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; class VorgangModelAssemblerTest { @@ -116,12 +116,12 @@ class VorgangModelAssemblerTest { @Test void shouldContainsAssignedToParameter() { - var requestCriteria = requestCriteriaBuilder.assignedTo(Optional.of(GoofyUserTestFactory.ID)).build(); + var requestCriteria = requestCriteriaBuilder.assignedTo(Optional.of(UserProfileTestFactory.ID)).build(); var link = getNextLinkByRequest(requestCriteria); assertThat(link).isPresent().get().extracting(Link::getHref) - .isEqualTo(BASE_PATH + "?page=2&assignedTo=" + GoofyUserTestFactory.ID.toString()); + .isEqualTo(BASE_PATH + "?page=2&assignedTo=" + UserProfileTestFactory.ID.toString()); } private Optional<Link> getNextLinkByRequest(FindVorgaengeHeaderRequestCriteria requestCriteria) { @@ -166,11 +166,11 @@ class VorgangModelAssemblerTest { @Test void shouldContainsAssignedToParameter() { - var requestCriteria = requestCriteriaBuilder.assignedTo(Optional.of(GoofyUserTestFactory.ID)).build(); + var requestCriteria = requestCriteriaBuilder.assignedTo(Optional.of(UserProfileTestFactory.ID)).build(); var link = getPrevLinkByRequest(requestCriteria); - assertThat(link).isPresent().get().extracting(Link::getHref).isEqualTo(BASE_PATH + "?page=1&assignedTo=" + GoofyUserTestFactory.ID); + assertThat(link).isPresent().get().extracting(Link::getHref).isEqualTo(BASE_PATH + "?page=1&assignedTo=" + UserProfileTestFactory.ID); } private Optional<Link> getPrevLinkByRequest(FindVorgaengeHeaderRequestCriteria requestCriteria) { diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangRemoteServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangRemoteServiceTest.java index 26db0fbab07fc09481d68dcb789a668191739da3..5b8926d629a2ecb3b75661683924db961ab100a1 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangRemoteServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangRemoteServiceTest.java @@ -38,10 +38,10 @@ import org.mockito.Mock; import org.mockito.Spy; import de.itvsh.goofy.common.user.CurrentUserService; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.common.user.UserId; import de.itvsh.goofy.common.user.UserRole; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.Vorgang.VorgangStatus; import de.itvsh.ozg.pluto.vorgang.GrpcFilterBy; import de.itvsh.ozg.pluto.vorgang.GrpcFindVorgangRequest; @@ -194,14 +194,14 @@ class VorgangRemoteServiceTest { @BeforeEach void mockUserService() { when(userService.hasRole(any())).thenReturn(false); - when(userService.getUser()).thenReturn(GoofyUserTestFactory.create()); + when(userService.getUser()).thenReturn(UserProfileTestFactory.create()); } @Test void shouldBeSetIfExists() { - var filterCriteria = callService(Optional.of(GoofyUserTestFactory.ID)); + var filterCriteria = callService(Optional.of(UserProfileTestFactory.ID)); - assertThat(filterCriteria.getAssignedTo()).isEqualTo(GoofyUserTestFactory.ID.toString()); + assertThat(filterCriteria.getAssignedTo()).isEqualTo(UserProfileTestFactory.ID.toString()); } @Test @@ -263,7 +263,7 @@ class VorgangRemoteServiceTest { @Test void shouldCallUserService() { - when(userService.getUser()).thenReturn(GoofyUserTestFactory.create()); + when(userService.getUser()).thenReturn(UserProfileTestFactory.create()); callService(); @@ -272,7 +272,7 @@ class VorgangRemoteServiceTest { @Test void shouldFillFilterByOrganisationseinheitenId() { - when(userService.getUser()).thenReturn(GoofyUserTestFactory.create()); + when(userService.getUser()).thenReturn(UserProfileTestFactory.create()); var filterBy = callService(); @@ -281,7 +281,7 @@ class VorgangRemoteServiceTest { @Test void shouldFillOrganisationseinheitenId() { - when(userService.getUser()).thenReturn(GoofyUserTestFactory.create()); + when(userService.getUser()).thenReturn(UserProfileTestFactory.create()); var filterBy = callService(); diff --git a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangWithEingangTestFactory.java b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangWithEingangTestFactory.java index 764b86dd884b7489c74163e83d3abe04d5145f0f..ff4cf21e4522a3fdcbdfddd554b700192e891278 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangWithEingangTestFactory.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/vorgang/VorgangWithEingangTestFactory.java @@ -25,7 +25,7 @@ package de.itvsh.goofy.vorgang; import static de.itvsh.goofy.vorgang.VorgangHeaderTestFactory.*; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; public class VorgangWithEingangTestFactory { @@ -37,7 +37,7 @@ public class VorgangWithEingangTestFactory { return VorgangWithEingang.builder() .id(ID) .version(VERSION) - .assignedTo(GoofyUserTestFactory.ID) + .assignedTo(UserProfileTestFactory.ID) .name(NAME) .status(STATUS) .nummer(NUMMER) diff --git a/goofy-server/src/test/java/de/itvsh/goofy/wiedervorlage/WiedervorlageServiceTest.java b/goofy-server/src/test/java/de/itvsh/goofy/wiedervorlage/WiedervorlageServiceTest.java index c6352b5c127999365f48da5b434da1d6605cd730..dd8f9730232d4211ecfab2011de19d158ab36fda 100644 --- a/goofy-server/src/test/java/de/itvsh/goofy/wiedervorlage/WiedervorlageServiceTest.java +++ b/goofy-server/src/test/java/de/itvsh/goofy/wiedervorlage/WiedervorlageServiceTest.java @@ -49,7 +49,7 @@ import de.itvsh.goofy.common.command.Command; import de.itvsh.goofy.common.command.CommandService; import de.itvsh.goofy.common.command.CommandTestFactory; import de.itvsh.goofy.common.user.CurrentUserService; -import de.itvsh.goofy.common.user.GoofyUserTestFactory; +import de.itvsh.goofy.common.user.UserProfileTestFactory; import de.itvsh.goofy.vorgang.VorgangHeaderTestFactory; class WiedervorlageServiceTest { @@ -103,7 +103,7 @@ class WiedervorlageServiceTest { @BeforeEach void mockServices() { - when(currentUserService.getUserId()).thenReturn(GoofyUserTestFactory.ID); + when(currentUserService.getUserId()).thenReturn(UserProfileTestFactory.ID); } @Test @@ -117,7 +117,7 @@ class WiedervorlageServiceTest { void shouldSetCreatedBy() throws Exception { var wiedervorlage = callAddCreated(); - assertThat(wiedervorlage.getCreatedBy()).isEqualTo(GoofyUserTestFactory.ID.toString()); + assertThat(wiedervorlage.getCreatedBy()).isEqualTo(UserProfileTestFactory.ID.toString()); } private Wiedervorlage callAddCreated() {