diff --git a/pkg/util/k8sutil/errors_test.go b/pkg/util/k8sutil/errors_test.go index 7b6dcf1b5..54c3e474f 100644 --- a/pkg/util/k8sutil/errors_test.go +++ b/pkg/util/k8sutil/errors_test.go @@ -1,3 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2018 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// +// Author Jan Christoph Uhde +// + package k8sutil import ( @@ -20,7 +42,7 @@ var ( func TestIsAlreadyExists(t *testing.T) { assert.False(t, IsAlreadyExists(conflictError)) - assert.False(t, IsConflict(maskAny(invalidError))) + assert.False(t, IsAlreadyExists(maskAny(invalidError))) assert.True(t, IsAlreadyExists(existsError)) assert.True(t, IsAlreadyExists(maskAny(existsError))) } @@ -34,7 +56,7 @@ func TestIsConflict(t *testing.T) { func TestIsNotFound(t *testing.T) { assert.False(t, IsNotFound(invalidError)) - assert.False(t, IsConflict(maskAny(invalidError))) + assert.False(t, IsNotFound(maskAny(invalidError))) assert.True(t, IsNotFound(notFoundError)) assert.True(t, IsNotFound(maskAny(notFoundError))) } diff --git a/pkg/util/k8sutil/probes_test.go b/pkg/util/k8sutil/probes_test.go index f9da63cbc..d3302509d 100644 --- a/pkg/util/k8sutil/probes_test.go +++ b/pkg/util/k8sutil/probes_test.go @@ -1,3 +1,25 @@ +// +// DISCLAIMER +// +// Copyright 2018 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// +// Author Jan Christoph Uhde +// + package k8sutil import ( diff --git a/pkg/util/k8sutil/test/doc.go b/pkg/util/k8sutil/test/doc.go new file mode 100644 index 000000000..e5c774f9b --- /dev/null +++ b/pkg/util/k8sutil/test/doc.go @@ -0,0 +1,29 @@ +// +// DISCLAIMER +// +// Copyright 2018 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// +// Author Jan Christoph Uhde +// + +package test + +// This package is used to resolve cyclic imports +// between k8sutil and other packages that include +// the k8sutil package. The other packages required +// by the tests as they provide implementations for +// interfaces defined by k8sutil that need to be tested. diff --git a/pkg/util/k8sutil/test/events_test.go b/pkg/util/k8sutil/test/events_test.go index e8f099f3a..8aba4097d 100644 --- a/pkg/util/k8sutil/test/events_test.go +++ b/pkg/util/k8sutil/test/events_test.go @@ -1,4 +1,26 @@ -package k8sutil_test +// +// DISCLAIMER +// +// Copyright 2018 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// +// Author Jan Christoph Uhde +// + +package test import ( "errors" @@ -56,9 +78,3 @@ func TestErrorEvent(t *testing.T) { assert.Equal(t, event.Reason, "Reason") assert.Equal(t, event.Type, v1.EventTypeWarning) } - -// // not accessible outside the package -// func TestDeploymentEvent(t *testing.T) { -// event := k8sutil.New("member name", "role", &apiObjectForTest) -// assert.Equal(t, event.Type, v1.EventTypeNormal) -// }