[ 
https://issues.apache.org/jira/browse/HADOOP-17685?focusedWorklogId=595212&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-595212
 ]

ASF GitHub Bot logged work on HADOOP-17685:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/May/21 10:58
            Start Date: 12/May/21 10:58
    Worklog Time Spent: 10m 
      Work Description: tasanuma commented on a change in pull request #2983:
URL: https://github.com/apache/hadoop/pull/2983#discussion_r630937412



##########
File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/alias/TestCredentialProviderFactory.java
##########
@@ -250,18 +247,14 @@ public void testLocalJksProvider() throws Exception {
   }
 
   @Test
-  public void testLocalBCFKSProvider() throws Exception {
+  public void testLocalBCFKSProvider() {
     Configuration conf = new Configuration();
     final Path ksPath = new Path(tmpDir.toString(), "test.bcfks");
     final String ourUrl = LocalBouncyCastleFipsKeyStoreProvider.SCHEME_NAME +
         "://file" + ksPath.toUri();
     conf.set(CredentialProviderFactory.CREDENTIAL_PROVIDER_PATH, ourUrl);
-
-    exception.expect(IOException.class);
-    exception.expectMessage("Can't create keystore");
-    List<CredentialProvider> providers =
-        CredentialProviderFactory.getProviders(conf);
-    assertTrue("BCFKS needs additional JDK setup", providers.isEmpty());
+    assertThrows("Can't create keystore", IOException.class,
+        () -> CredentialProviderFactory.getProviders(conf));

Review comment:
       It seems not to validate the error message. Per the [junit 
docs](https://junit.org/junit5/docs/current/user-guide/#writing-tests-assertions),
   ```suggestion
       Exception exception = assertThrows(IOException.class,
           () -> CredentialProviderFactory.getProviders(conf));
       assertEquals("Can't create keystore", exception.getMessage());
   ```

##########
File path: 
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java
##########
@@ -50,6 +50,7 @@
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.hadoop.fs.CommonConfigurationKeysPublic;
+import org.assertj.core.api.Assertions;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;

Review comment:
       ```suggestion
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 595212)
    Time Spent: 1h 10m  (was: 1h)

> Fix junit deprecation warnings in hadoop-common module
> ------------------------------------------------------
>
>                 Key: HADOOP-17685
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17685
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: test
>            Reporter: Akira Ajisaka
>            Assignee: Akira Ajisaka
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Fix HADOOP-17684 in hadoop-common module.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to