@@ -36,6 +36,9 @@ public class TableInfoTest {
3636 private static final Long CREATION_TIME = 10L ;
3737 private static final Long EXPIRATION_TIME = 100L ;
3838 private static final Long LAST_MODIFIED_TIME = 20L ;
39+ private static final Boolean REQUIRE_PARTITION_FILTER = true ;
40+ private static final EncryptionConfiguration ENCRYPTION_CONFIGURATION =
41+ EncryptionConfiguration .newBuilder ().setKmsKeyName ("KMS_KEY_1" ).build ();
3942
4043 private static final Field FIELD_SCHEMA1 =
4144 Field .newBuilder ("StringField" , LegacySQLTypeName .STRING )
@@ -91,6 +94,7 @@ public class TableInfoTest {
9194 TableInfo .newBuilder (TABLE_ID , TABLE_DEFINITION )
9295 .setCreationTime (CREATION_TIME )
9396 .setDescription (DESCRIPTION )
97+ .setEncryptionConfiguration (ENCRYPTION_CONFIGURATION )
9498 .setEtag (ETAG )
9599 .setExpirationTime (EXPIRATION_TIME )
96100 .setFriendlyName (FRIENDLY_NAME )
@@ -101,6 +105,7 @@ public class TableInfoTest {
101105 .setNumRows (BigInteger .valueOf (NUM_ROWS ))
102106 .setSelfLink (SELF_LINK )
103107 .setLabels (Collections .singletonMap ("a" , "b" ))
108+ .setRequirePartitionFilter (REQUIRE_PARTITION_FILTER )
104109 .build ();
105110 private static final TableInfo VIEW_INFO =
106111 TableInfo .newBuilder (TABLE_ID , VIEW_DEFINITION )
@@ -151,6 +156,7 @@ public void testBuilder() {
151156 assertEquals (TABLE_ID , TABLE_INFO .getTableId ());
152157 assertEquals (CREATION_TIME , TABLE_INFO .getCreationTime ());
153158 assertEquals (DESCRIPTION , TABLE_INFO .getDescription ());
159+ assertEquals (ENCRYPTION_CONFIGURATION , TABLE_INFO .getEncryptionConfiguration ());
154160 assertEquals (ETAG , TABLE_INFO .getEtag ());
155161 assertEquals (EXPIRATION_TIME , TABLE_INFO .getExpirationTime ());
156162 assertEquals (FRIENDLY_NAME , TABLE_INFO .getFriendlyName ());
@@ -161,6 +167,7 @@ public void testBuilder() {
161167 assertEquals (NUM_BYTES , TABLE_INFO .getNumBytes ());
162168 assertEquals (NUM_LONG_TERM_BYTES , TABLE_INFO .getNumLongTermBytes ());
163169 assertEquals (BigInteger .valueOf (NUM_ROWS ), TABLE_INFO .getNumRows ());
170+ assertEquals (REQUIRE_PARTITION_FILTER , TABLE_INFO .getRequirePartitionFilter ());
164171
165172 assertEquals (TABLE_ID , VIEW_INFO .getTableId ());
166173 assertEquals (VIEW_DEFINITION , VIEW_INFO .getDefinition ());
@@ -192,33 +199,39 @@ public void testOf() {
192199 assertEquals (TABLE_ID , tableInfo .getTableId ());
193200 assertNull (tableInfo .getCreationTime ());
194201 assertNull (tableInfo .getDescription ());
202+ assertNull (tableInfo .getEncryptionConfiguration ());
195203 assertNull (tableInfo .getEtag ());
196204 assertNull (tableInfo .getExpirationTime ());
197205 assertNull (tableInfo .getFriendlyName ());
198206 assertNull (tableInfo .getGeneratedId ());
199207 assertNull (tableInfo .getLastModifiedTime ());
208+ assertNull (tableInfo .getRequirePartitionFilter ());
200209 assertEquals (TABLE_DEFINITION , tableInfo .getDefinition ());
201210 assertNull (tableInfo .getSelfLink ());
202211 tableInfo = TableInfo .of (TABLE_ID , VIEW_DEFINITION );
203212 assertEquals (TABLE_ID , tableInfo .getTableId ());
204213 assertNull (tableInfo .getCreationTime ());
205214 assertNull (tableInfo .getDescription ());
215+ assertNull (tableInfo .getEncryptionConfiguration ());
206216 assertNull (tableInfo .getEtag ());
207217 assertNull (tableInfo .getExpirationTime ());
208218 assertNull (tableInfo .getFriendlyName ());
209219 assertNull (tableInfo .getGeneratedId ());
210220 assertNull (tableInfo .getLastModifiedTime ());
221+ assertNull (tableInfo .getRequirePartitionFilter ());
211222 assertEquals (VIEW_DEFINITION , tableInfo .getDefinition ());
212223 assertNull (tableInfo .getSelfLink ());
213224 tableInfo = TableInfo .of (TABLE_ID , EXTERNAL_TABLE_DEFINITION );
214225 assertEquals (TABLE_ID , tableInfo .getTableId ());
215226 assertNull (tableInfo .getCreationTime ());
216227 assertNull (tableInfo .getDescription ());
228+ assertNull (tableInfo .getEncryptionConfiguration ());
217229 assertNull (tableInfo .getEtag ());
218230 assertNull (tableInfo .getExpirationTime ());
219231 assertNull (tableInfo .getFriendlyName ());
220232 assertNull (tableInfo .getGeneratedId ());
221233 assertNull (tableInfo .getLastModifiedTime ());
234+ assertNull (tableInfo .getRequirePartitionFilter ());
222235 assertEquals (EXTERNAL_TABLE_DEFINITION , tableInfo .getDefinition ());
223236 assertNull (tableInfo .getSelfLink ());
224237 }
@@ -250,6 +263,7 @@ private void compareTableInfo(TableInfo expected, TableInfo value) {
250263 assertEquals (expected .getDefinition (), value .getDefinition ());
251264 assertEquals (expected .getCreationTime (), value .getCreationTime ());
252265 assertEquals (expected .getDescription (), value .getDescription ());
266+ assertEquals (expected .getEncryptionConfiguration (), value .getEncryptionConfiguration ());
253267 assertEquals (expected .getEtag (), value .getEtag ());
254268 assertEquals (expected .getExpirationTime (), value .getExpirationTime ());
255269 assertEquals (expected .getFriendlyName (), value .getFriendlyName ());
@@ -260,6 +274,8 @@ private void compareTableInfo(TableInfo expected, TableInfo value) {
260274 assertEquals (expected .getNumRows (), value .getNumRows ());
261275 assertEquals (expected .getSelfLink (), value .getSelfLink ());
262276 assertEquals (expected .getLabels (), value .getLabels ());
277+ assertEquals (expected .getRequirePartitionFilter (), value .getRequirePartitionFilter ());
278+ assertEquals (expected .toString (), value .toString ());
263279 assertEquals (expected .hashCode (), value .hashCode ());
264280 }
265281}
0 commit comments