mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 10:58:51 +00:00
dependencies: Refactor unit tests without depending on Guava (#2181)
* Refactor unit tests without depending on Guava * Remove redundant casts. * Move import up * Update repository/src/test/java/com/iluwatar/repository/RepositoryTest.java Co-authored-by: Robert Volkmann <20912167+robertvolkmann@users.noreply.github.com> * Update repository/src/test/java/com/iluwatar/repository/AnnotationBasedRepositoryTest.java Co-authored-by: Robert Volkmann <20912167+robertvolkmann@users.noreply.github.com> Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com> Co-authored-by: Robert Volkmann <20912167+robertvolkmann@users.noreply.github.com>
This commit is contained in:
@@ -24,11 +24,9 @@
|
||||
*/
|
||||
package com.iluwatar.value.object;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.not;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
|
||||
import com.google.common.testing.EqualsTester;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
@@ -47,7 +45,7 @@ class HeroStatTest {
|
||||
void testEquals() {
|
||||
var heroStatA = HeroStat.valueOf(3, 9, 2);
|
||||
var heroStatB = HeroStat.valueOf(3, 9, 2);
|
||||
new EqualsTester().addEqualityGroup(heroStatA, heroStatB).testEquals();
|
||||
assertEquals(heroStatA, heroStatB);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,9 +57,8 @@ class HeroStatTest {
|
||||
var heroStatA = HeroStat.valueOf(3, 9, 2);
|
||||
var heroStatB = HeroStat.valueOf(3, 9, 2);
|
||||
var heroStatC = HeroStat.valueOf(3, 9, 8);
|
||||
|
||||
assertThat(heroStatA.toString(), is(heroStatB.toString()));
|
||||
assertThat(heroStatA.toString(), is(not(heroStatC.toString())));
|
||||
assertEquals(heroStatA.toString(), heroStatB.toString());
|
||||
assertNotEquals(heroStatA.toString(), heroStatC.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user