mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-08-06 02:23:19 +00:00
dependencies: Upgrade mockito 3.5 to 4.5 (#2316)
* refactor: move tests of leader-followers into correct package * dep: remove version constraint for Mockito in acyclic-visitor * dep: remove version constraint for Mockito in caching * chore: cleanup mockito-core import on some POMs * dep: upgrade core.mocktio 3.5.6 to 4.5.1 "- org.mockito.Mockito#verifyZeroInteractions an alias of verifyNoMoreInteractions" https://github.com/mockito/mockito/commit/caf35b24e2764df0498469526ecb3e7ec68a0430
This commit is contained in:
@@ -53,6 +53,10 @@ public class MongoDb implements DbManager {
|
||||
private MongoClient client;
|
||||
private MongoDatabase db;
|
||||
|
||||
void setDB(MongoDatabase db) {
|
||||
this.db = db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to Db. Check th connection
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.bson.Document;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.internal.util.reflection.Whitebox;
|
||||
|
||||
import static com.iluwatar.caching.constants.CachingConstants.ADD_INFO;
|
||||
import static com.iluwatar.caching.constants.CachingConstants.USER_ID;
|
||||
@@ -56,10 +55,8 @@ class MongoDbTest {
|
||||
@BeforeEach
|
||||
void init() {
|
||||
db = mock(MongoDatabase.class);
|
||||
Whitebox.setInternalState(mongoDb, "db", db);
|
||||
mongoDb.setDB(db);
|
||||
userAccount = new UserAccount(ID, NAME, ADDITIONAL_INFO);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user