Skip to content
Snippets Groups Projects
Commit f2c8c2f8 authored by Felix Reichenbach's avatar Felix Reichenbach
Browse files

OZG-3936 use UserId in TestEntity

parent a3bd7127
Branches
Tags
1 merge request!16Ozg 3936 refactor user profile url provider
This commit is part of merge request !16. Comments created here will be created in the context of that merge request.
......@@ -45,6 +45,7 @@ import org.springframework.hateoas.Link;
import com.thedeanda.lorem.LoremIpsum;
import de.ozgcloud.alfa.common.user.UserId;
import de.ozgcloud.alfa.common.user.UserManagerUrlProvider;
import lombok.SneakyThrows;
......@@ -363,7 +364,7 @@ class LinkedResourceProcessorTest {
@ParameterizedTest
@NullAndEmptySource
void shouldNotAddLinkIfFieldValueIsNullOrBlank(String userValue) {
var model = EntityModel.of(TestEntityTestFactory.createBuilder().user(userValue).build());
var model = EntityModel.of(TestEntityTestFactory.createBuilder().user(UserId.from(userValue)).build());
var field = getField("user");
processor.addLinkForLinkedUserProfileResourceField(model, field);
......
......@@ -33,6 +33,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import de.ozgcloud.alfa.common.user.UserId;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
......@@ -52,7 +53,7 @@ class TestEntity {
private String[] arrayField;
@LinkedUserProfileResource
private String user;
private UserId user;
@LinkedUserProfileResource
private String differentUserId;
......@@ -103,7 +104,7 @@ class TestEntityTestFactory {
return TestEntity.builder()
.testId(ID)
.linkedResource(LINKED_RESOURCE)
.user(USER)
.user(UserId.from(USER))
.differentUserId(DIFFERENT_USER_ID)
.foo("bar");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment