Add test for MapDBVar.toString

This commit is contained in:
Carolin Brandt 2022-05-18 16:33:09 +02:00
parent 622cab39fc
commit 91de0dd3a3
No known key found for this signature in database
GPG Key ID: 3E3152C50E79FED7

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());
}
}