-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test validate service broker api version function #345
test validate service broker api version function #345
Conversation
err := mockALMBroker(ctrl).ValidateBrokerAPIVersion("n/a") | ||
require.EqualError(t, err, "not implemented") | ||
// test bad version | ||
brokerMock := mockALMBroker(ctrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be done without the operatorclient mocks? It's just more work to remove operator client if we use them in new code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These use whatever is in the generated clientsets:
https://github.com/operator-framework/operator-lifecycle-manager/pull/345/files/d9dd9c928c52c1d3c32ff2a9cff4717f63da804e#diff-3a028458a1ff8c8a41758933f6670271L9
Do those need to be updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope, that's good - I just saw mock and assumed it was using the MockOperatorClient!
d9dd9c9
to
d72a161
Compare
d72a161
to
09c9908
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
testNamespace = "testns" | ||
) | ||
|
||
func mockALMBroker(ctrl *gomock.Controller) *ALMBroker { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can remove ctrl, it's unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
func TestValidateBrokerAPIVersion(t *testing.T) { | ||
ctrl := gomock.NewController(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, you don't need ctrl or the defer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fcd9672
to
f2f9847
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…catalog test validate service broker api version function
…catalog test validate service broker api version function
Add test of the implementation to validate supported versions of the Open Service Broker as per the service broker interface. All current versions (2.11, 2.12, and 2.13) are supported.