我在获取工作表的列 ID 时遇到问题。下面是我失败的单元测试。关于我做错了什么有什么想法吗?看起来 ID 没有进入 Column 模型。
它失败了:java.lang.AssertionError: Column "Primary Column" has null Id.
@Test
public void getColumnInfo() {
try {
Token token = new Token();
token.setAccessToken(TEST_API_TOKEN);
Smartsheet conn = new SmartsheetBuilder().setAccessToken(token.getAccessToken()).build();
List<Column> columns = conn.sheets().columns().listColumns(TEST_SHEET_ID);
org.junit.Assert.assertTrue("Sheet has columns.", columns.size() > 0);
for (Column column : columns) {
String columnName = column.getTitle();
org.junit.Assert.assertNotNull("Column has null Title.", columnName);
org.junit.Assert.assertNotNull("Column \"" + columnName + "\" has null Index.", column.getIndex());
org.junit.Assert.assertNotNull("Column \"" + columnName + "\" has null Type.", column.getType());
org.junit.Assert.assertNotNull("Column \"" + columnName + "\" has null Id.", column.getId());
}
} catch (Exception ex) {
org.junit.Assert.assertNull("Exception calling API.", ex);
}
}
这是Smartsheet Java SDK的 v1.1.0 。