Exception using new consumer version selector method in kotlin
See original GitHub issueHi,
I started to migrate the @Deprecated
consumerVersionSelectors = [ ]
in the @PactBroker
annotation by the new way, using @PactBrokerConsumerVersionSelectors
method like this. See bottom line:
However when running my PactTest that ran using commented-out code above, I get this exception:
I debugged a bit your library and figured, that this line tries to invoke the identified selectorsMethod
with a testInstance
param that is Optional.empty()
though. I find it strange that invokeSelectorsMethod
thinks my selector method has 1 param even though it doesn’t. This circumstance is explicitly handled in testClassHasSelectorsMethod
:
- Kotlin version: 1.7.10
- Pact version: 4.3.13
- junit5: yes,
PactVerificationInvocationContextProvider
What else I tried:
- Moving my selector method out of abstract class and into to concrete test class
- Making it “kotlin static” leads to not running into my breakpoint in
testClassHasSelectorsMethod
even, because its not contained intestClass?.kotlin?.members
:
companion object {
@PactBrokerConsumerVersionSelectors
@JvmStatic
fun consumerVersionSelectors(): SelectorBuilder = SelectorBuilder().branch("my-branch")
}
Issue Analytics
- State:
- Created a year ago
- Comments:15 (14 by maintainers)
Top Results From Across the Web
Consumer Version Selectors | Pact Docs
Consumer version selectors are the (new) way to configure which pacts the provider verifies. Instead of providing a list of tag names (as...
Read more >Releases · pact-foundation/pact-jvm - GitHub
Enables consumer driven contract testing, providing a mock service ... example JUnit4 Spring test using new consumer version selector method ...
Read more >Exception - Android Developers
Unchecked exception thrown when an attempt is made to register a channel with a selector that was not created by the provider that...
Read more >Understanding variant selection - Gradle User Manual
For all Ivy modules without variants, Gradle has a fallback selection method. Gradle does not perform variant aware resolution and instead selects either...
Read more >Kotlin Language Documentation 1.7.21
New Kotlin K2 compiler for the JVM in Alpha ... Migration from an interface with constructor function to a ... Retrieve with selector....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix confirmed, this code works now:
Thanks a lot for this fast workflow, fix released just 3 days later, that’s amazing.
@viktorgt PACT has released the fix tonight.