Fix #8579: Add unit test to cover the cases where columnProfile is null or not being sent by client (#9038)

* Fix #8171: add test to make sure column profile can be sent as null or empty, it shouldn't break addProfileData API

* Fix #8171: add test to make sure column profile can be sent as null or empty, it shouldn't break addProfileData API
This commit is contained in:
Sriharsha Chintalapani 2022-11-29 23:30:12 -08:00 committed by GitHub
parent 6393ed03dc
commit e06935d3fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1252,6 +1252,22 @@ public class TableResourceTest extends EntityResourceTest<Table, CreateTable> {
table1 = getEntity(table1.getId(), "*", authHeaders);
verifyTableProfile(table1.getProfile(), table1ProfileList.get(table1ProfileList.size() - 1));
// Table profile with column profile as null
timestamp = TestUtils.dateToTimestamp("2022-09-09");
tableProfile =
new TableProfile().withRowCount(6.0).withColumnCount(3.0).withTimestamp(timestamp).withProfileSample(10.0);
createTableProfile = new CreateTableProfile().withTableProfile(tableProfile).withColumnProfile(null);
putResponse = putTableProfileData(table.getId(), createTableProfile, authHeaders);
verifyTableProfile(putResponse.getProfile(), createTableProfile.getTableProfile());
// Table profile without column profile
timestamp = TestUtils.dateToTimestamp("2022-10-09");
tableProfile =
new TableProfile().withRowCount(6.0).withColumnCount(3.0).withTimestamp(timestamp).withProfileSample(10.0);
createTableProfile = new CreateTableProfile().withTableProfile(tableProfile);
putResponse = putTableProfileData(table.getId(), createTableProfile, authHeaders);
verifyTableProfile(putResponse.getProfile(), createTableProfile.getTableProfile());
}
@Test