File: counters_test.go

package info (click to toggle)
golang-github-openfga-go-sdk 0.6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 1,960 kB
  • sloc: makefile: 13
file content (22 lines) | stat: -rw-r--r-- 710 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package telemetry

import (
	"testing"
)

func TestCredentialsRequestCounter(t *testing.T) {
	expectedName := METRIC_COUNTER_CREDENTIALS_REQUEST
	expectedDescription := "The total number of times new access tokens have been requested using ClientCredentials."

	if CredentialsRequest == nil {
		t.Fatalf("Expected CredentialsRequest to be initialized, but got nil")
	}

	if CredentialsRequest.GetName() != expectedName {
		t.Errorf("Expected Name to be '%s', but got '%s'", expectedName, CredentialsRequest.GetName())
	}

	if CredentialsRequest.GetDescription() != expectedDescription {
		t.Errorf("Expected Description to be '%s', but got '%s'", expectedDescription, CredentialsRequest.GetDescription())
	}
}