import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Test
public void updateShouldBeTraced() throws Exception {
// Given
SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
// When
sqlMapClient.update("updateId");
sqlMapClient.update("updateId", new Object());
// Then
final List spanEvents = getCurrentSpanEvents();
assertThat(spanEvents.size(), is(2));
// Check Method
final SpanEventBo updateWith1ArgSpanEvent = spanEvents.get(0);
final SpanEventBo updateWith2ArgSpanEvent = spanEvents.get(1);
assertThat(updateWith1ArgSpanEvent.getApiId(), not(0));
assertThat(updateWith2ArgSpanEvent.getApiId(), not(0));
assertThat(updateWith1ArgSpanEvent.getApiId(), not(updateWith2ArgSpanEvent.getApiId()));
// Check Parameter
final List updateWith1ArgAnnotations = updateWith1ArgSpanEvent.getAnnotationBoList();
assertThat(updateWith1ArgAnnotations.size(), is(1));
final AnnotationBo updateWith1ArgParameterAnnotation = updateWith1ArgAnnotations.get(0);
assertThat(updateWith1ArgParameterAnnotation.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));
final List updateWith2ArgAnnotations = updateWith2ArgSpanEvent.getAnnotationBoList();
assertThat(updateWith2ArgAnnotations.size(), is(1));
final AnnotationBo updateWith2ArgAnnotation = updateWith2ArgAnnotations.get(0);
assertThat(updateWith2ArgAnnotation.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));
}