Skip to content

Commit

Permalink
fix: put data in data not "partitionid"
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare committed Jul 16, 2023
1 parent ecb8131 commit d558340
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
Receives events from Pathfinder via RestApi, converts them to CloudEvents
and sends them to a `cloudevents` topic in Kafka.
paths:
/webhhook:
/webhook:
post:
summary: Receive a POST request and generate a CloudEvent.
requestBody:
Expand Down
2 changes: 1 addition & 1 deletion pathfinderevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def from_pathfinder_request(request: Request) -> CloudEvent:
"source": "https://github.com/radiorabe/pathfinder-cloudevents-service",
"subject": form["channel"][0],
"datacontenttype": "text/plain",
"partitionid": form["channel"][0],
},
form["channel"][0],
)


Expand Down
4 changes: 2 additions & 2 deletions test_pathfinderevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ def test_api_webhook(mock_producer, mock_api, mock_sys_exit):
headers=None,
)
value = json.loads(mock_producer.send.call_args.kwargs["value"])
assert value["data"] is None
assert value["data"] == "Klangbecken"
assert value["datacontenttype"] == "text/plain"
assert value["partitionid"] == "Klangbecken"
assert "partitionid" not in value
assert (
value["source"] == "https://github.com/radiorabe/pathfinder-cloudevents-service"
)
Expand Down

0 comments on commit d558340

Please sign in to comment.