create own endpoints for user conversion and apply changed workflow to user form in ui

This commit is contained in:
Eduard Heimbuch
2020-10-22 13:15:54 +02:00
parent 69950f63b3
commit 5b10dc57ac
12 changed files with 296 additions and 67 deletions

View File

@@ -90,14 +90,15 @@ public class UserToUserDtoMapperTest {
}
@Test
public void shouldGetPasswordLinkForAdmin() {
public void shouldGetInternalUserLinks() {
User user = createDefaultUser();
user.setExternal(false);
when(subject.isPermitted("user:modify:abc")).thenReturn(true);
when(userManager.isTypeDefault(eq(user))).thenReturn(true);
UserDto userDto = mapper.map(user);
assertEquals("expected password link with modify permission", expectedBaseUri.resolve("abc/password").toString(), userDto.getLinks().getLinkBy("password").get().getHref());
assertEquals("expected convert to external link with modify permission", expectedBaseUri.resolve("abc/convert-to-external").toString(), userDto.getLinks().getLinkBy("convertToExternal").get().getHref());
}
@Test