Skip to content

Commit

Permalink
feat: minor changes to email verification
Browse files Browse the repository at this point in the history
Signed-off-by: Morten Svanaes <[email protected]>
  • Loading branch information
netroms committed Dec 17, 2024
1 parent 3d26e95 commit 6dc5195
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
import org.hisp.dhis.jsontree.JsonList;

/**
* Web API equivalent of a {@link org.hisp.dhis.user.User}.
* Web API equivalent of a {@link org.hisp.dhis.webapi.controller.user.MeDto}.
*
* @author Jan Bernitt
* @author Morten Svanæs
*/
public interface JsonMe extends JsonIdentifiableObject {
public interface JsonMeDto extends JsonIdentifiableObject {
default String getUsername() {
return getString("username").string();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.hisp.dhis.security.apikey.ApiKeyTokenGenerator;
import org.hisp.dhis.security.apikey.ApiTokenStore;
import org.hisp.dhis.test.webapi.H2ControllerIntegrationTestBase;
import org.hisp.dhis.test.webapi.json.domain.JsonMe;
import org.hisp.dhis.test.webapi.json.domain.JsonMeDto;
import org.hisp.dhis.user.CurrentUserUtil;
import org.hisp.dhis.user.User;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -77,7 +77,7 @@ void setUp() {
@Test
void testGetCurrentUser() {
switchToAdminUser();
assertEquals(getCurrentUser().getUid(), GET("/me").content().as(JsonMe.class).getId());
assertEquals(getCurrentUser().getUid(), GET("/me").content().as(JsonMeDto.class).getId());
}

@Test
Expand All @@ -97,7 +97,7 @@ void testGetAuthorities() {
@Test
void testUpdateCurrentUser() {
assertSeries(Series.SUCCESSFUL, PUT("/me", "{'surname':'Lars'}"));
assertEquals("Lars", GET("/me").content().as(JsonMe.class).getSurname());
assertEquals("Lars", GET("/me").content().as(JsonMeDto.class).getSurname());
}

@Test
Expand All @@ -110,7 +110,7 @@ void testHasAuthority() {

@Test
void testGetEmailVerifiedProperty() {
assertFalse(GET("/me").content().as(JsonMe.class).getEmailVerified());
assertFalse(GET("/me").content().as(JsonMeDto.class).getEmailVerified());
}

@Test
Expand Down Expand Up @@ -279,6 +279,6 @@ void testGetCurrentUserAttributeValues() {
userService.updateUser(userByUsername);

assertEquals(
"myvalue", GET("/me").content().as(JsonMe.class).getAttributeValues().get(0).getValue());
"myvalue", GET("/me").content().as(JsonMeDto.class).getAttributeValues().get(0).getValue());
}
}

0 comments on commit 6dc5195

Please sign in to comment.