Skip to content

Commit

Permalink
fix: Refactor test to reuse LocalRegistryFile (#2763)
Browse files Browse the repository at this point in the history
Signed-off-by: yanghua <yanghua1127@gmail.com>
  • Loading branch information
yanghua authored Jun 7, 2022
1 parent 7d16516 commit 4339c0a
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions java/serving/src/test/java/feast/serving/it/ServingBaseTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@
import feast.proto.serving.ServingAPIProto;
import feast.proto.serving.ServingAPIProto.FieldStatus;
import feast.proto.types.ValueProto;
import feast.serving.registry.LocalRegistryFile;
import feast.serving.util.DataGenerator;
import io.grpc.StatusRuntimeException;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -62,14 +60,8 @@ protected ServingAPIProto.GetOnlineFeaturesRequest buildOnlineRequest(int driver
static RegistryProto.Registry registryProto = readLocalRegistry();

private static RegistryProto.Registry readLocalRegistry() {
try {
return RegistryProto.Registry.parseFrom(
Files.readAllBytes(Paths.get("src/test/resources/docker-compose/feast10/registry.db")));
} catch (IOException e) {
e.printStackTrace();
}

return null;
return new LocalRegistryFile("src/test/resources/docker-compose/feast10/registry.db")
.getContent();
}

@Test
Expand Down

0 comments on commit 4339c0a

Please sign in to comment.