INNER CODE UNIT · Go

TestShouldApplyPausedResourceAction

streamnative/function-mesh · controllers/common_pause_test.go:52

func TestShouldApplyPausedResourceAction(t *testing.T) {
	if !shouldApplyPausedResourceAction(v1alpha1.Create) {
		t.Fatal("expected create action to be allowed while paused")
	}
	if !shouldApplyPausedResourceAction(v1alpha1.Delete) {
		t.Fatal("expected delete action to be allowed while paused")
	}

	blockedActions := []v1alpha1.ReconcileAction{
		v1alpha1.Update,
		v1alpha1.Wait,
		v1alpha1.NoAction,
	}
	for _, action := range blockedActions {
		if shouldApplyPausedResourceAction(action) {
			t.Fatalf("did not expect %s action to be allowed while paused", action)
		}
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…