diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2024-04-29 00:55:54 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2024-04-29 15:20:41 +0200 |
commit | 07e77293b1e84fddfdc5edbb378021a93427c971 (patch) | |
tree | f8eb616a8ed6da85de4944ab903bfb9499c9b03e /org.eclipse.jgit.test | |
parent | 1d253988076e8848b8e30141229624cfc7b62c06 (diff) | |
download | jgit-07e77293b1e84fddfdc5edbb378021a93427c971.tar.gz jgit-07e77293b1e84fddfdc5edbb378021a93427c971.zip |
[errorprone] Fix pattern UseCorrectAssertInTests
See https://errorprone.info/bugpattern/UseCorrectAssertInTests
Change-Id: Iffde63ac795ad30c3e7774764cb8189cb089ed86
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java index 3b0e184a42..1c2e995bbb 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java @@ -14,6 +14,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.eclipse.jgit.util.FileUtils.RECURSIVE; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.junit.Assume.assumeTrue; @@ -879,7 +880,7 @@ public class AddCommandTest extends RepositoryTestCase { } } // Help null pointer analysis. - assert lastFile != null; + assertNotNull(lastFile); // Wait a bit. If entries are "racily clean", we'll recompute // hashes from the disk files, and then the second add is also slow. // We want to test the normal case. @@ -1260,7 +1261,7 @@ public class AddCommandTest extends RepositoryTestCase { "[git-link-dir, mode:160000]", indexState(0)); Set<String> untrackedFiles = git.status().call().getUntracked(); - assert untrackedFiles.isEmpty(); + assertTrue(untrackedFiles.isEmpty()); } } @@ -1275,7 +1276,8 @@ public class AddCommandTest extends RepositoryTestCase { ConfigConstants.CONFIG_KEY_DIRNOGITLINKS, true); config.save(); - assert db.getConfig().get(WorkingTreeOptions.KEY).isDirNoGitLinks(); + assertTrue( + db.getConfig().get(WorkingTreeOptions.KEY).isDirNoGitLinks()); try (Git git = new Git(db)) { git.add().addFilepattern("nested-repo").call(); |