This commit is contained in:
zyyang 2020-11-14 12:35:59 +08:00
parent deb6cd23f9
commit ee814ac85b
2 changed files with 15 additions and 12 deletions

View File

@ -1,14 +1,17 @@
spring:
datasource:
driver-class-name: com.taosdata.jdbc.TSDBDriver
url: jdbc:TAOS://master:6030/mp_test
user: root
password: taosdata
# driver-class-name: com.taosdata.jdbc.TSDBDriver
# url: jdbc:TAOS://localhost:6030/mp_test
# user: root
# password: taosdata
# charset: UTF-8
# locale: en_US.UTF-8
# timezone: UTC-8
# driver-class-name: com.mysql.jdbc.Driver
# url: jdbc:mysql://master:3306/test?useSSL=false
# username: root
# password: 123456
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://master:3306/test?useSSL=false
username: root
password: 123456
logging:
level:

View File

@ -34,23 +34,23 @@ public class WeatherMapperTest {
@Test
public void testInsert() {
Weather weather = new Weather();
weather.setTs(new Timestamp(System.currentTimeMillis()));
weather.setTs(new Timestamp(1605024000000l));
weather.setTemperature(random.nextFloat() * 50);
weather.setHumidity(random.nextInt(100));
weather.setLocation("望京");
weather.setLocation("wangjing");
int affectRows = mapper.insert(weather);
Assert.assertEquals(1, affectRows);
}
@Test
public void testDelete() {
mapper.delete(new QueryWrapper<Weather>().eq("location", "望京"));
mapper.delete(new QueryWrapper<Weather>().eq("location", "wangjing"));
}
@Test
public void testDeleteByMap() {
Map<String, Object> map = new HashMap<>();
map.put("location", "望京");
map.put("location", "wangjing");
int affectRows = mapper.deleteByMap(map);
// Assert.assertEquals(0, affectRows);
}