This commit is contained in:
Raghunandan
2020-02-26 11:25:33 +01:00
parent 329b776125
commit da855cbde9
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ import (
pb "github.com/spotify/backstage/proto/inventory/v1"
)
var entityURI = "boss://test/test"
var entityURI = "entity:test:test"
func TestServer(t *testing.T) {
testStorage := NewTestStorage()
@@ -35,7 +35,7 @@ func TestServer(t *testing.T) {
t.Errorf("ServerTest(ListEntities) expected %v items, got %v", 1, len(list.GetEntities()))
}
if list.GetEntities()[0].GetUri() != entityURI {
t.Errorf("ServerTest(ListEntities) expected uri %v, got %v", "boss://test/test", list.GetEntities()[0].GetUri())
t.Errorf("ServerTest(ListEntities) expected uri %v, got %v", "entity:test:test", list.GetEntities()[0].GetUri())
}
expectedFacts := []*pb.Fact{{Name: "test-name", Value: "test-value"}}
if !reflect.DeepEqual(list.GetEntities()[0].GetFacts(), expectedFacts) {
@@ -47,7 +47,7 @@ func TestServer(t *testing.T) {
entity := &pb.Entity{Uri: entityURI}
s.CreateEntity(context.Background(), &pb.CreateEntityRequest{Entity: entity})
list, err := s.ListEntities(context.Background(), &pb.ListEntitiesRequest{UriPrefix: "boss://test2"})
list, err := s.ListEntities(context.Background(), &pb.ListEntitiesRequest{UriPrefix: "entity:test2"})
if err != nil {
t.Errorf("ServerTest(TestServerListEntities) could not list: %v", err)
}
@@ -17,11 +17,11 @@ import { inventoryV1 } from '@backstage/protobuf-definitions';
const client = new inventoryV1.Client('http://localhost:8080');
const entityUriRegex = /boss:\/\/service\/(.*)/;
const entityUriRegex = /entity:service:(.*)/;
async function fetchServices() {
const req = new inventoryV1.ListEntitiesRequest();
req.setUriprefix('boss://service/');
req.setUriprefix('entity:service:');
const res = await client.listEntities(req);
return res