Skip to content

Commit 6b32871

Browse files
feat(bigtable): mark CBT Authorized View admin APIs as unimplemented in the emulator (#10562)
* Mark CBT Authorized View admin APIs as unimplemented in the emulator So to avoid unnecessary panic. * Mark CBT Authorized View admin APIs as unimplemented in the emulator So to avoid unnecessary panic.
1 parent 1bb4c84 commit 6b32871

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

bigtable/bttest/inmem.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1779,3 +1779,23 @@ func toColumnFamilies(families map[string]*columnFamily) map[string]*btapb.Colum
17791779
}
17801780
return fs
17811781
}
1782+
1783+
func (s *server) CreateAuthorizedView(context.Context, *btapb.CreateAuthorizedViewRequest) (*longrunning.Operation, error) {
1784+
return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support authorized views")
1785+
}
1786+
1787+
func (s *server) GetAuthorizedView(context.Context, *btapb.GetAuthorizedViewRequest) (*btapb.AuthorizedView, error) {
1788+
return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support authorized views")
1789+
}
1790+
1791+
func (s *server) ListAuthorizedViews(context.Context, *btapb.ListAuthorizedViewsRequest) (*btapb.ListAuthorizedViewsResponse, error) {
1792+
return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support authorized views")
1793+
}
1794+
1795+
func (s *server) DeleteAuthorizedView(context.Context, *btapb.DeleteAuthorizedViewRequest) (*emptypb.Empty, error) {
1796+
return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support authorized views")
1797+
}
1798+
1799+
func (s *server) UpdateAuthorizedView(context.Context, *btapb.UpdateAuthorizedViewRequest) (*longrunning.Operation, error) {
1800+
return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support authorized views")
1801+
}

bigtable/bttest/inmem_test.go

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,3 +2504,44 @@ func TestFilterRowCellsPerRowLimitFilterTruthiness(t *testing.T) {
25042504
}
25052505
}
25062506
}
2507+
2508+
func TestAuthorizedViewApis(t *testing.T) {
2509+
s := &server{
2510+
tables: make(map[string]*table),
2511+
}
2512+
ctx := context.Background()
2513+
_, err := populateTable(ctx, s)
2514+
if err != nil {
2515+
t.Fatal(err)
2516+
}
2517+
2518+
_, err = s.CreateAuthorizedView(ctx, &btapb.CreateAuthorizedViewRequest{})
2519+
if fmt.Sprint(err) !=
2520+
"rpc error: code = Unimplemented desc = the emulator does not currently support authorized views" {
2521+
t.Fatalf("Failed to error %s", err)
2522+
}
2523+
2524+
_, err = s.GetAuthorizedView(ctx, &btapb.GetAuthorizedViewRequest{})
2525+
if fmt.Sprint(err) !=
2526+
"rpc error: code = Unimplemented desc = the emulator does not currently support authorized views" {
2527+
t.Fatalf("Failed to error %s", err)
2528+
}
2529+
2530+
_, err = s.ListAuthorizedViews(ctx, &btapb.ListAuthorizedViewsRequest{})
2531+
if fmt.Sprint(err) !=
2532+
"rpc error: code = Unimplemented desc = the emulator does not currently support authorized views" {
2533+
t.Fatalf("Failed to error %s", err)
2534+
}
2535+
2536+
_, err = s.UpdateAuthorizedView(ctx, &btapb.UpdateAuthorizedViewRequest{})
2537+
if fmt.Sprint(err) !=
2538+
"rpc error: code = Unimplemented desc = the emulator does not currently support authorized views" {
2539+
t.Fatalf("Failed to error %s", err)
2540+
}
2541+
2542+
_, err = s.DeleteAuthorizedView(ctx, &btapb.DeleteAuthorizedViewRequest{Name: "av_name"})
2543+
if fmt.Sprint(err) !=
2544+
"rpc error: code = Unimplemented desc = the emulator does not currently support authorized views" {
2545+
t.Fatalf("Failed to error %s", err)
2546+
}
2547+
}

0 commit comments

Comments
 (0)