Skip to content

Commit b15c36b

Browse files
committed
Removed one unused test
1 parent c7b8d0a commit b15c36b

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

apps/managedidentity/managedidentity_test.go

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -698,71 +698,6 @@ func TestAppServiceAcquireTokenReturnsTokenSuccess(t *testing.T) {
698698
}
699699
}
700700

701-
// TestAppServiceWithClientCapabilities tests the scenario when App Service includes client capabilities
702-
func TestAppServiceWithClientCapabilities(t *testing.T) {
703-
setEnvVars(t, AppService)
704-
705-
testCases := []struct {
706-
name string
707-
expectError bool
708-
expectedStatusCode int
709-
expectedToken string
710-
expectedCapabilities string
711-
capabilities []string
712-
}{
713-
{
714-
name: "Token Request with Client Capabilities",
715-
expectError: false,
716-
expectedStatusCode: http.StatusOK,
717-
expectedToken: token,
718-
expectedCapabilities: "c1,c2",
719-
capabilities: []string{"c1", "c2"},
720-
},
721-
}
722-
723-
for _, testCase := range testCases {
724-
t.Run(testCase.name, func(t *testing.T) {
725-
mockClient := mock.NewClient()
726-
localUrl := &url.URL{}
727-
responseBody, err := getSuccessfulResponse(resource, false)
728-
if err != nil {
729-
t.Fatalf(errorFormingJsonResponse, err.Error())
730-
}
731-
mockClient.AppendResponse(mock.WithHTTPStatusCode(http.StatusOK),
732-
mock.WithBody(responseBody),
733-
mock.WithCallback(func(r *http.Request) {
734-
localUrl = r.URL
735-
}))
736-
client, err := New(SystemAssigned(), WithHTTPClient(mockClient), WithClientCapabilities(testCase.capabilities))
737-
if err != nil {
738-
t.Fatal(err)
739-
}
740-
741-
result, err := client.AcquireToken(context.Background(), resource)
742-
if testCase.expectError {
743-
if err == nil {
744-
t.Fatal("Expected error but got nil")
745-
}
746-
var callErr errors.CallErr
747-
if !errors.As(err, &callErr) {
748-
t.Fatalf("Expected error of type CallErr, got %T", err)
749-
}
750-
} else {
751-
if err != nil {
752-
t.Fatalf("AcquireToken failed: %v", err)
753-
}
754-
if result.AccessToken != testCase.expectedToken {
755-
t.Fatalf("Expected access token %q, got %q", testCase.expectedToken, result.AccessToken)
756-
}
757-
localUrlQuerry := localUrl.Query()
758-
if localUrlQuerry.Get("xms_cc") != testCase.expectedCapabilities {
759-
t.Fatalf("Expected client capabilities %q, got %q", testCase.expectedCapabilities, localUrlQuerry.Get("xms_cc"))
760-
}
761-
}
762-
})
763-
}
764-
}
765-
766701
func TestAzureMLAcquireTokenReturnsTokenSuccess(t *testing.T) {
767702
defaultClientID := "A"
768703
t.Setenv("DEFAULT_IDENTITY_CLIENT_ID", defaultClientID)

0 commit comments

Comments
 (0)