-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support for DSL-like configuration specification
- Loading branch information
Showing
18 changed files
with
695 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
plugins { | ||
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/org/wiremock/extensions/state/extensions/Dsl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.wiremock.extensions.state.extensions; | ||
|
||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.wiremock.extensions.state.extensions.builder.DeleteStateEventListenerBuilder; | ||
import org.wiremock.extensions.state.extensions.builder.DeleteStateEventListenerBuilder.MultiContextBuilder; | ||
import org.wiremock.extensions.state.extensions.builder.DeleteStateEventListenerBuilder.SingleContextBuilder; | ||
import org.wiremock.extensions.state.extensions.builder.RecordStateEventListenerBuilder; | ||
import org.wiremock.extensions.state.extensions.builder.StateRequestMatcherBuilder; | ||
import org.wiremock.extensions.state.extensions.builder.StateRequestMatcherBuilder.HasContextBuilder; | ||
import org.wiremock.extensions.state.extensions.builder.StateRequestMatcherBuilder.HasNotContextBuilder; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
public class Dsl { | ||
|
||
public static @NotNull RecordStateEventListenerBuilder recordContext(@NotNull String context) { | ||
return RecordStateEventListenerBuilder.context(context); | ||
} | ||
|
||
public static @NotNull SingleContextBuilder deleteContext(@NotNull String context) { | ||
return DeleteStateEventListenerBuilder.context(context); | ||
} | ||
|
||
public static @NotNull MultiContextBuilder deleteContexts(@NotNull String... contexts) { | ||
return DeleteStateEventListenerBuilder.contexts(Arrays.asList(contexts)); | ||
} | ||
|
||
public static @NotNull MultiContextBuilder deleteContexts(@NotNull Collection<String> contexts) { | ||
return DeleteStateEventListenerBuilder.contexts(contexts); | ||
} | ||
|
||
public static @NotNull MultiContextBuilder deleteContextsMatching(@NotNull String contextMatching) { | ||
return DeleteStateEventListenerBuilder.contextsMatching(contextMatching); | ||
} | ||
|
||
public static @NotNull HasContextBuilder hasContext(@NotNull String context) { | ||
return StateRequestMatcherBuilder.hasContext(context); | ||
} | ||
|
||
public static @NotNull HasNotContextBuilder hasNotContext(@NotNull String context) { | ||
return StateRequestMatcherBuilder.hasNotContext(context); | ||
} | ||
} |
Oops, something went wrong.