Browse Source

Remove unneeded @SuppressWarnings("boxing")

Fix the unit tests to not do boxing by using assertEquals(int, int)
instead of assertThat with a matcher.

Change-Id: I5412fe2f72c8ea0227b9ff3a3352ccb555e22231
Signed-off-by: Hugo Arès <hugo.ares@ericsson.com>
stable-4.1
Hugo Arès 9 years ago
parent
commit
79974e20cc
  1. 8
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryCacheTest.java

8
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryCacheTest.java

@ -44,7 +44,6 @@
package org.eclipse.jgit.lib; package org.eclipse.jgit.lib;
import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNotNull;
@ -62,7 +61,6 @@ import org.eclipse.jgit.junit.RepositoryTestCase;
import org.eclipse.jgit.lib.RepositoryCache.FileKey; import org.eclipse.jgit.lib.RepositoryCache.FileKey;
import org.junit.Test; import org.junit.Test;
@SuppressWarnings("boxing")
public class RepositoryCacheTest extends RepositoryTestCase { public class RepositoryCacheTest extends RepositoryTestCase {
@Test @Test
public void testNonBareFileKey() throws IOException { public void testNonBareFileKey() throws IOException {
@ -154,7 +152,7 @@ public class RepositoryCacheTest extends RepositoryTestCase {
@Test @Test
public void testGetRegisteredWhenEmpty() { public void testGetRegisteredWhenEmpty() {
assertThat(RepositoryCache.getRegisteredKeys().size(), is(0)); assertEquals(0, RepositoryCache.getRegisteredKeys().size());
} }
@Test @Test
@ -163,7 +161,7 @@ public class RepositoryCacheTest extends RepositoryTestCase {
assertThat(RepositoryCache.getRegisteredKeys(), assertThat(RepositoryCache.getRegisteredKeys(),
hasItem(FileKey.exact(db.getDirectory(), db.getFS()))); hasItem(FileKey.exact(db.getDirectory(), db.getFS())));
assertThat(RepositoryCache.getRegisteredKeys().size(), is(1)); assertEquals(1, RepositoryCache.getRegisteredKeys().size());
} }
@Test @Test
@ -172,7 +170,7 @@ public class RepositoryCacheTest extends RepositoryTestCase {
RepositoryCache RepositoryCache
.unregister(FileKey.exact(db.getDirectory(), db.getFS())); .unregister(FileKey.exact(db.getDirectory(), db.getFS()));
assertThat(RepositoryCache.getRegisteredKeys().size(), is(0)); assertEquals(0, RepositoryCache.getRegisteredKeys().size());
} }
} }

Loading…
Cancel
Save