Skip to content

Conversation

@pradeepagrawal8184
Copy link
Contributor

What changes were proposed in this pull request?

Ranger junit test code migration from junit 4 to junit 5; some of the the test code were already moved to junit 5 via RANGER-4559 and RANGER-4730

How was this patch tested?

mvn clean install

cp.preSetTableQuota(mctx, tname, mock(GlobalQuotaSettings.class));
cp.preSetNamespaceQuota(mctx, "ns", mock(GlobalQuotaSettings.class));
Assertions.assertTrue(true);
try {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These additional changes are unrelated to the JUnit 4 to JUnit 5 migration. Wouldn’t it be better to handle them separately and keep this pull request focused solely on the changes required for the JUnit 5 migration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on it

Mockito.when(mgrMock.getHBaseConnection(Mockito.eq("svc"), Mockito.eq("type"), Mockito.any()))
.thenReturn(client);
Mockito.when(client.getTableList(Mockito.eq("tab.*".replaceAll("\\*", ".\\*")),
Mockito.when(client.getTableList(Mockito.eq("tab.*"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as my previous comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on it

Copy link
Contributor

@vyommani vyommani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, the changes look good to me. That said, I notice quite a few test modifications that aren't directly tied to the JUnit 4 to JUnit 5 migration. I think these additional test improvements are substantial enough to warrant their own separate PR. I'm not entirely sure how much effort it would take to split them out while keeping the migration changes intact in this PR.

@pradeepagrawal8184
Copy link
Contributor Author

Overall, the changes look good to me. That said, I notice quite a few test modifications that aren't directly tied to the JUnit 4 to JUnit 5 migration. I think these additional test improvements are substantial enough to warrant their own separate PR. I'm not entirely sure how much effort it would take to split them out while keeping the migration changes intact in this PR.

Currently I am trying to keep the previous junit 5 version or lower(if needed in any module) and same maven-surefire-plugin version, trying to remove reference of junit 4 as well;
Junit 5 migration is required before starting work on jdk17.
We might to fix/upgrade the tests again if failing in jdk17.

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.2</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.7.2 => ${junit.jupiter.version}

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-commons</artifactId>
<version>1.7.2</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest replacing 1.7.2 with a property like ${junit.platform.version}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants