Skip to content

Commit

Permalink
增加填充错误测试用例.
Browse files Browse the repository at this point in the history
  • Loading branch information
nieqiurong committed Mar 26, 2024
1 parent 642941c commit c8b5b3c
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,23 @@ public void updateFill(MetaObject metaObject) {
assertThat(m.getInsertOperator()).isNotNull();
assertThat(m.getUpdateOperator()).isNotNull();
});

byte[] bytes1 = new byte[]{};
model = new Model();
mappedStatement = new MappedStatement.Builder(configuration, "***", staticSqlSource, SqlCommandType.INSERT).build();
new MybatisParameterHandler(mappedStatement, Map.of("test", bytes1, Constants.ENTITY, model), boundSql);
assertThat(model.getId()).isNotNull();
assertThat(model.getInsertOperator()).isNotNull();
assertThat(model.getUpdateOperator()).isNull();

Byte[] bytes2 = new Byte[]{};
model = new Model();
mappedStatement = new MappedStatement.Builder(configuration, "***", staticSqlSource, SqlCommandType.INSERT).build();
new MybatisParameterHandler(mappedStatement, Map.of("test", bytes2, Constants.ENTITY, model), boundSql);
assertThat(model.getId()).isNotNull();
assertThat(model.getInsertOperator()).isNotNull();
assertThat(model.getUpdateOperator()).isNull();

}

}

0 comments on commit c8b5b3c

Please sign in to comment.