mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 10:59:03 +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,18 +24,15 @@
|
||||
*/
|
||||
package com.iluwatar.model.view.viewmodel;
|
||||
|
||||
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.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import com.google.common.testing.EqualsTester;
|
||||
|
||||
class BookTest {
|
||||
|
||||
@@ -67,13 +64,13 @@ class BookTest {
|
||||
|
||||
@Test
|
||||
void testEquals() {
|
||||
new EqualsTester().addEqualityGroup(testBook, testBookTwo).testEquals();
|
||||
assertEquals(testBook, testBookTwo);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testToString() {
|
||||
assertThat(testBook.toString(), is(testBookTwo.toString()));
|
||||
assertThat(testBook.toString(), is(not(testBookThree.toString())));
|
||||
assertEquals(testBook.toString(), testBookTwo.toString());
|
||||
assertNotEquals(testBook.toString(), testBookThree.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user