Skip to content
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

java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 when query param with out value #1788

Closed
WhiteBite opened this issue Apr 15, 2024 · 4 comments
Labels
bug Indicates an unexpected problem or unintended behavior smartbear-supported SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear

Comments

@WhiteBite
Copy link

WhiteBite commented Apr 15, 2024

I have some strange conroller

    @GetMapping(params = "example-param")
    public LocalDate findActiveQualificationStartDate(ExampleDataDTO searchData) {
        return exampleService.findExampleData(searchData);
    }
    

And my query is
http://localhost:8080/?example-param&innerParam=Test1&innerParam2=Test2

And then when i can build pact
i make uri

    URIBuilder uriBuilder = new URIBuilder()
                .addParameter("qualification-start-date", null)
                ....
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

	at java.base/java.util.Collections$SingletonList.get(Collections.java:4959)
	at au.com.dius.pact.core.model.PactReaderKt.queryStringToMap(PactReader.kt:160)
	at au.com.dius.pact.consumer.dsl.PactDslRequestWithPath.query(PactDslRequestWithPath.kt:163)
	at pact.ExampleDataClientPactTest.createPact(ExampleDataClientPactTest.java:52)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
@rholshausen rholshausen added bug Indicates an unexpected problem or unintended behavior smartbear-supported SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear labels Apr 17, 2024
Copy link

🤖 Great news! We've labeled this issue as smartbear-supported and created a tracking ticket in PactFlow's Jira (PACT-1952). We'll keep work public and post updates here. Meanwhile, feel free to check out our docs. Thanks for your patience!

@rholshausen
Copy link
Contributor

4.6.9 has been released with a fix

@WhiteBite
Copy link
Author

4.6.9 has been released with a fix

Can you compiler 4.5.9 for java 11 and depoy to maven?

@rholshausen
Copy link
Contributor

4.5.9 released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior smartbear-supported SmartBear engineering team will support this issue. See https://docs.pact.io/help/smartbear
Projects
None yet
Development

No branches or pull requests

2 participants