Skip to content

Commit

Permalink
chore(knative): Add step to delete Knative trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
christophd committed Feb 19, 2024
1 parent 3b64984 commit f198be6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions java/docs/steps-knative.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ Given create Knative trigger {trigger} on channel {channel} with filter on attri
The step uses a data table with attributes and values that should be added to the filter. As a result
the trigger will only handle events matching the given filters.

==== Delete Knative trigger

You can delete a trigger by giving its name in the current namespace.

.@Given("^delete Knative trigger {trigger}$")
[source,gherkin]
----
Given delete Knative trigger {trigger}
----

This removes the Knative trigger from the current namespace.

[[knative-channels]]
=== Create channels

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public void createTriggerFiltered(String triggerName, String channelName, DataTa
}
}

@Given("^delete Knative trigger ([^\\s]+)$")
public void deleteTrigger(String triggerName) {
runner.then(knative().client(k8sClient).client(knativeClient)
.trigger()
.delete(triggerName));
}

private void setBrokerName(String brokerName) {
this.brokerName = brokerName;

Expand Down

0 comments on commit f198be6

Please sign in to comment.