Merge pull request #1070 from lacinoire/add-test

Add test for MapDBVar.toString
This commit is contained in:
Ruben Bermudez 2022-06-15 01:01:44 +02:00 committed by GitHub
commit 92c7b1c3ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,4 +143,17 @@ class MapDBContextTest {
Var<User> changedVar = db.getVar(varName);
assertEquals(changedVar.get(), USER);
}
@Test
void testToString() throws Exception {
String varName = "somevar";
Var<User> var = db.getVar(varName);
var.set(CREATOR);
db.commit();
var = db.getVar(varName);
var.set(USER);
db.commit();
Var<User> changedVar = db.getVar(varName);
Assertions.assertEquals("MapDBVar{var=User(id=1, firstName=first, isBot=false, lastName=last, userName=username, languageCode=null, canJoinGroups=false, canReadAllGroupMessages=false, supportInlineQueries=false)}", ((MapDBVar) (changedVar)).toString());
}
}