Skip to content

Commit

Permalink
feat(metrics-operator): add unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: realanna <anna.reale@dynatrace.com>
  • Loading branch information
RealAnna committed Sep 21, 2023
1 parent c4c2a2c commit 147526d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lifecycle-operator/controllers/common/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,22 @@ func TestGetOptionsInstance(t *testing.T) {
timeout := o2.GetCreationRequestTimeout()
require.Equal(t, 5*time.Second, timeout)
}

func TestConfig_SetAndGetDefaultNamespace(t *testing.T) {
i := Instance()

ns := i.GetDefaultNamespace()

require.Empty(t, ns)
i.SetDefaultNamespace("test")
require.Equal(t, "test", i.GetDefaultNamespace())
}

func TestConfig_SetAndGetCloudEventEndpoint(t *testing.T) {
i := Instance()

ns := i.GetCloudEventsEndpoint()
require.Empty(t, ns)
i.SetCloudEventsEndpoint("mytestendpoint")
require.Equal(t, "mytestendpoint", i.GetCloudEventsEndpoint())
}

0 comments on commit 147526d

Please sign in to comment.