assertNull(mapper.selectAuthor(101));
}
@Test
public void shouldUpdateAuthorUsingMapperClass() throws Exception {
AuthorMapper mapper = manager.getMapper(AuthorMapper.class);
Author expected = mapper.selectAuthor(101);
expected.setUsername("NewUsername");
int count = mapper.updateAuthor(expected);
assertEquals(1, count);
Author actual = mapper.selectAuthor(101);
assertEquals(expected.getUsername(), actual.getUsername());
}