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

NPE when creating STUB with no headers section defined #52

Open
szymon-owczarzak opened this issue Mar 29, 2021 · 2 comments
Open

NPE when creating STUB with no headers section defined #52

szymon-owczarzak opened this issue Mar 29, 2021 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@szymon-owczarzak
Copy link

szymon-owczarzak commented Mar 29, 2021

HttpHeader header = definition.getHeaders().getHeader(ContentTypeHeader.KEY);

Wiremock does not require the headers section for the request/response sections. Please consider some reasonable defaults when header section is not present.

{
  "mappings": [
    {
      "request": {
        "method": "GET",
        "url": "/my-document-pdf"
      },
      "response": {
        "status": 200,
        "bodyFileName": "documents/my.pdf"
      }
    }
  ]
}
java.lang.NullPointerException: null
	at com.cognifide.aem.stubs.wiremock.transformers.PebbleTransformer.hasTextMimeType(PebbleTransformer.java:97) [com.cognifide.aem.stubs.wiremock:2.0.1]
	at com.cognifide.aem.stubs.wiremock.transformers.PebbleTransformer.lambda$transformBody$3(PebbleTransformer.java:88) [com.cognifide.aem.stubs.wiremock:2.0.1]
	at java.util.Optional.map(Optional.java:215)
@pun-ky
Copy link
Collaborator

pun-ky commented Mar 29, 2021

@marcinkp hardening needed :)

@pun-ky
Copy link
Collaborator

pun-ky commented Oct 4, 2021

IMO pebble templating is introducing many incompatibilities and I am quite sure that supporting it should be dropped

@krystian-panek-wttech krystian-panek-wttech added the help wanted Extra attention is needed label Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants