use of com.baomidou.mybatisplus.samples.reduce.springmvc.entity.City in project mybatis-plus-samples by baomidou.
the class ReduceTest method testGeneratedMapper.
@Test
public void testGeneratedMapper() {
String cityMapperClassName = "cityMapper";
BaseMapper cityMapper = (BaseMapper) context.getBean(cityMapperClassName);
City city = (City) cityMapper.selectById(1);
Assertions.assertEquals(city.getId().longValue(), 1L);
String districtMapperClassName = "districtMapper";
boolean isContained = context.containsBean(districtMapperClassName);
Assertions.assertFalse(isContained);
// BaseMapper districtMapper =(BaseMapper) context.getBean(districtMapperClassName);
// District district = (District) districtMapper.selectById(1);
// Assertions.assertEquals(district.getId().longValue(),1L);
String userMapperClassName = "userMapper";
BaseMapper userMapper = (BaseMapper) context.getBean(userMapperClassName);
userMapper.selectById(1);
User user = (User) userMapper.selectById(1);
Assertions.assertEquals(user.getId().longValue(), 1L);
}
Aggregations