@@ -1108,39 +1108,9 @@ public void shouldUpdateExistingTableWithValidSpec() {
11081108 }
11091109
11101110 @ Test
1111- public void shouldNotUpdateIfNoChanges () {
1112- FeatureTableProto .FeatureTable table = apiClient .applyFeatureTable ("default" , getTestSpec ());
1113- FeatureTableProto .FeatureTable updatedTable =
1114- apiClient .applyFeatureTable ("default" , getTestSpec ());
1115-
1116- assertThat (updatedTable .getMeta ().getRevision (), equalTo (table .getMeta ().getRevision ()));
1117- }
1118-
1119- @ Test
1120- public void shouldErrorOnMissingBatchSource () {
1121- FeatureTableProto .FeatureTableSpec spec =
1122- DataGenerator .createFeatureTableSpec (
1123- "ft" ,
1124- List .of ("entity1" ),
1125- Map .of ("event_timestamp" , ValueProto .ValueType .Enum .INT64 ),
1126- 3600 ,
1127- Map .of ())
1128- .toBuilder ()
1129- .build ();
1130-
1131- StatusRuntimeException exc =
1132- assertThrows (
1133- StatusRuntimeException .class , () -> apiClient .applyFeatureTable ("default" , spec ));
1134-
1135- assertThat (
1136- exc .getMessage (),
1137- equalTo ("INVALID_ARGUMENT: FeatureTable batch source cannot be empty." ));
1138- }
1139-
1140- @ Test
1141- public void shouldErrorIfEntityChangeOnUpdate () {
1111+ public void shouldUpdateFeatureTableOnEntityChange () {
11421112 List <String > entities = Arrays .asList ("entity1" , "entity2" );
1143- FeatureTableProto .FeatureTableSpec spec =
1113+ FeatureTableProto .FeatureTableSpec updatedSpec =
11441114 DataGenerator .createFeatureTableSpec (
11451115 "featuretable1" ,
11461116 Arrays .asList ("entity1" ),
@@ -1157,21 +1127,15 @@ public void shouldErrorIfEntityChangeOnUpdate() {
11571127 DataGenerator .createFileDataSourceSpec ("file:///path/to/file" , "ts_col" , "" ))
11581128 .build ();
11591129
1160- StatusRuntimeException exc =
1161- assertThrows (
1162- StatusRuntimeException .class , () -> apiClient .applyFeatureTable ("default" , spec ));
1130+ FeatureTableProto .FeatureTable updatedTable =
1131+ apiClient .applyFeatureTable ("default" , updatedSpec );
11631132
1164- assertThat (
1165- exc .getMessage (),
1166- equalTo (
1167- String .format (
1168- "INVALID_ARGUMENT: Updating the entities of a registered FeatureTable is not allowed: %s to %s" ,
1169- entities , spec .getEntitiesList ())));
1133+ assertTrue (TestUtil .compareFeatureTableSpec (updatedTable .getSpec (), updatedSpec ));
11701134 }
11711135
11721136 @ Test
1173- public void shouldErrorIfFeatureValueTypeChangeOnUpdate () {
1174- FeatureTableProto .FeatureTableSpec spec =
1137+ public void shouldUpdateFeatureTableOnFeatureTypeChange () {
1138+ FeatureTableProto .FeatureTableSpec updatedSpec =
11751139 DataGenerator .createFeatureTableSpec (
11761140 "featuretable1" ,
11771141 Arrays .asList ("entity1" , "entity2" ),
@@ -1188,16 +1152,40 @@ public void shouldErrorIfFeatureValueTypeChangeOnUpdate() {
11881152 DataGenerator .createFileDataSourceSpec ("file:///path/to/file" , "ts_col" , "" ))
11891153 .build ();
11901154
1155+ FeatureTableProto .FeatureTable updatedTable =
1156+ apiClient .applyFeatureTable ("default" , updatedSpec );
1157+
1158+ assertTrue (TestUtil .compareFeatureTableSpec (updatedTable .getSpec (), updatedSpec ));
1159+ }
1160+
1161+ @ Test
1162+ public void shouldNotUpdateIfNoChanges () {
1163+ FeatureTableProto .FeatureTable table = apiClient .applyFeatureTable ("default" , getTestSpec ());
1164+ FeatureTableProto .FeatureTable updatedTable =
1165+ apiClient .applyFeatureTable ("default" , getTestSpec ());
1166+
1167+ assertThat (updatedTable .getMeta ().getRevision (), equalTo (table .getMeta ().getRevision ()));
1168+ }
1169+
1170+ @ Test
1171+ public void shouldErrorOnMissingBatchSource () {
1172+ FeatureTableProto .FeatureTableSpec spec =
1173+ DataGenerator .createFeatureTableSpec (
1174+ "ft" ,
1175+ List .of ("entity1" ),
1176+ Map .of ("event_timestamp" , ValueProto .ValueType .Enum .INT64 ),
1177+ 3600 ,
1178+ Map .of ())
1179+ .toBuilder ()
1180+ .build ();
1181+
11911182 StatusRuntimeException exc =
11921183 assertThrows (
11931184 StatusRuntimeException .class , () -> apiClient .applyFeatureTable ("default" , spec ));
11941185
11951186 assertThat (
11961187 exc .getMessage (),
1197- equalTo (
1198- String .format (
1199- "INVALID_ARGUMENT: Updating the value type of a registered Feature is not allowed: %s to %s" ,
1200- ValueProto .ValueType .Enum .FLOAT , ValueProto .ValueType .Enum .STRING_LIST )));
1188+ equalTo ("INVALID_ARGUMENT: FeatureTable batch source cannot be empty." ));
12011189 }
12021190
12031191 @ Test
0 commit comments