Improve Expectation integration test by Donnerbart · Pull Request #3084 · operator-framework/java-operator-sdk

From my understanding it's not optimal to use the context from the current reconciliation in Expectation.createExpectation(). This will hog on that specific instance, including the (cloned) primary resource instance that is internally stored in DefaultContext. This could have a bad impact on GC, and I think it could even lead to bugs when context.getPrimaryResource() is used in the expectation (since that primary resource might have outdated data).

The Expectation.createExpectation(name, predicate) provides the primary and context, that should be preferred to be used.

Fixed the integration test and references in the documentation and blog post. Also fixed all warnings in the test and re-ordered the methods by their usage in the code. Fixed the time unit for the timeout (from seconds to millis).