Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <[email protected]>
  • Loading branch information
pavolloffay committed Feb 21, 2022
1 parent 9056b21 commit deb93ad
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pkg/controller/elasticsearch/elasticsearch_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
v1 "github.com/jaegertracing/jaeger-operator/apis/v1"
)

func TestElasticsearchController(t *testing.T) {
func TestControllerReconcile(t *testing.T) {
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
Name: "prod",
Expand Down Expand Up @@ -76,3 +76,19 @@ func TestElasticsearchController(t *testing.T) {
}, updated)
assert.Equal(t, int32(3), updated.Spec.Storage.Elasticsearch.NodeCount)
}

func TestControllerReconcile_not_found(t *testing.T) {
esv1.AddToScheme(scheme.Scheme)
v1.AddToScheme(scheme.Scheme)
cl := fake.NewClientBuilder().WithRuntimeObjects().Build()
reconciler := New(cl, cl)

result, err := reconciler.Reconcile(context.Background(), reconcile.Request{
NamespacedName: types.NamespacedName{
Namespace: "prod",
Name: "my-es",
},
})
require.NoError(t, err)
assert.Equal(t, reconcile.Result{}, result)
}

0 comments on commit deb93ad

Please sign in to comment.