func TestK8testing(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
mockContext := prmmock.NewMockStepContext(ctrl)
mockResource := prmmock.NewMockResource(ctrl)
mockClient := prmmock.NewMockClient(ctrl)
// testClient := fake.NewFakeClientWithScheme(runtime.NewScheme())
lables := make(map[string]string)
mockClient.EXPECT().GetResource(gomock.Any(), gomock.Any()).Return(mockResource, nil).AnyTimes()
mockContext.EXPECT().Resource().Return(mockResource).AnyTimes()
mockResource.EXPECT().GetKind().Return("data-movement-v1-nonexist").AnyTimes()
mockResource.EXPECT().GetName().Return("test-dm-more-then-forty-eight-charactors-this-should-fail").AnyTimes()
mockResource.EXPECT().GetNamespace().Return("ns-more-then-forty-eight-charactors-this-should-fail").AnyTimes()
mockResource.EXPECT().GetLabels().Return(lables).AnyTimes()
mockResource.EXPECT().GetID().Return(prm.NewResourceID("hcc-dm", "data-movement-v1", "test-dm")).AnyTimes()
err := validateK8ResourcesLength(mockResource)
assert.Error(t, err)
if assert.Error(t, err) {
//assert.Contains(t, err, "length combined must not be greater")
assert.Equal(t, "Namespace (ns-more-then-forty-eight-charactors-this-should-fail) and Name (test-dm-more-then-forty-eight-charactors-this-should-fail) length combined must not be greater than 48 chars", err)
}
}