Skip to content

Commit

Permalink
update some test code to java8 style
Browse files Browse the repository at this point in the history
  • Loading branch information
jtnord committed Dec 5, 2019
1 parent a6c3144 commit 1136242
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.nio.charset.StandardCharsets;

import org.apache.commons.io.IOUtils;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -43,12 +42,9 @@ public void testMigrationOfNexusPassword() throws Exception {
assertThat("round tripped password", d.getNexusPassword().getPlainText(), is(PASSWORD));

File f = new File(jr.jenkins.root, M2ReleaseBuildWrapper.class.getName() + ".xml");
FileInputStream fis = new FileInputStream(f);
try {
String content = IOUtils.toString(fis, "UTF-8");
try (FileInputStream fis = new FileInputStream(f)) {
String content = IOUtils.toString(fis, StandardCharsets.UTF_8);
assertThat("password should be encrypted", content, not(containsString(PASSWORD)));
} finally {
fis.close();
}

}
Expand Down

0 comments on commit 1136242

Please sign in to comment.