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:
kongleong86
2022-12-04 11:25:57 +02:00
committed by GitHub
co-authored by Ilkka Seppälä Robert Volkmann
parent ce5605b4d5
commit 2d309b8928
11 changed files with 14 additions and 50 deletions
-7
View File
@@ -37,7 +37,6 @@
<version>1.26.0-SNAPSHOT</version>
<properties>
<zk.version>9.0.0</zk.version>
<guava.version>19.0</guava.version>
<jetty-maven-plugin.version>9.4.28.v20200408</jetty-maven-plugin.version>
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<maven-assembly-plugin.version>2.2</maven-assembly-plugin.version>
@@ -84,12 +83,6 @@
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-testlib</artifactId>
<version>${guava.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
@@ -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