Skip to content

Commit

Permalink
Fix disabled data integrity unit tests (#18198)
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-p-pickering authored Jul 25, 2024
1 parent 5a0dd73 commit 65fee23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.hisp.dhis.test.webapi.json.domain.JsonDataIntegrityDetails;
import org.hisp.dhis.test.webapi.json.domain.JsonDataIntegritySummary;
import org.hisp.dhis.user.User;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -54,7 +53,6 @@ class DataIntegrityUsersWithInvalidUsernameControllerTest

private static final String DETAILS_ID_TYPE = "users";

@Disabled("TODO(Jason P. Pickering)")
@Test
void testCanFlagUsersWithInvalidUsername() {

Expand Down Expand Up @@ -84,10 +82,10 @@ void testCanFlagUsersWithInvalidUsername() {
assertEquals(DETAILS_ID_TYPE, details.getIssuesIdType());
assertEquals(CHECK_NAME, details.getName());

// There are already two existing users as part of the test setup, thus 5/7 users have bad
// There is already an existing user as part of the test setup, thus 5/6 users have bad
// usernames
JsonDataIntegritySummary summary = getSummary(CHECK_NAME);
assertTrue(almostEqual(71.4, summary.getPercentage().doubleValue(), 0.1));
assertTrue(almostEqual(83.3, summary.getPercentage().doubleValue(), 0.1));
assertEquals(badUsernames.size(), summary.getCount());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.hisp.dhis.jsontree.JsonList;
import org.hisp.dhis.test.webapi.json.domain.JsonDataIntegrityDetails;
import org.hisp.dhis.user.User;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

/**
Expand All @@ -49,7 +48,6 @@ class DataIntegrityUsersWithNoRoleControllerTest extends AbstractDataIntegrityIn

private static final String DETAILS_ID_TYPE = "users";

@Disabled("TODO(Jason P. Pickering)")
@Test
void testCanFlagUserWithNoRoles() {

Expand All @@ -65,10 +63,10 @@ void testCanFlagUserWithNoRoles() {
manager.persist(user);
dbmsManager.clearSession();

// Note that there are already two users which exist due to the overall test setup, thus, three
// Note that there is already one user which exists due to the overall test setup, thus, two
// users in total.
assertHasDataIntegrityIssues(
DETAILS_ID_TYPE, CHECK_NAME, 33, user.getUid(), user.getUsername(), "disabled:false", true);
DETAILS_ID_TYPE, CHECK_NAME, 50, user.getUid(), user.getUsername(), "disabled:false", true);

JsonDataIntegrityDetails details = getDetails(CHECK_NAME);
JsonList<JsonDataIntegrityDetails.JsonDataIntegrityIssue> issues = details.getIssues();
Expand Down

0 comments on commit 65fee23

Please sign in to comment.