public class RestDocumentationContextPlaceholderResolver
extends java.lang.Object
implements org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
PropertyPlaceholderHelper.PlaceholderResolver
that resolves placeholders using a
RestDocumentationContext
. The following placeholders are supported:
step
- the step current
count
.
methodName
- the unmodified name of the
current test method
without
applying any formatting
method-name
- the name of the
current test method
formatted
using kebab-case
method_name
- the name of the
current test method
formatted
using snake_case
ClassName
- the unmodified simple name
of the
current test class
class-name
- the simple name
of the
current test class
formatted using
kebab-case
class_name
- the simple name
of the
current test class
formatted using
snake case
Constructor and Description |
---|
RestDocumentationContextPlaceholderResolver(RestDocumentationContext context)
Creates a new placeholder resolver that will resolve placeholders using the given
context . |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
camelCaseToKebabCase(java.lang.String string)
Converts the given
string from camelCase to kebab-case. |
protected java.lang.String |
camelCaseToSnakeCase(java.lang.String string)
Converts the given
string from camelCase to snake_case. |
protected RestDocumentationContext |
getContext()
Returns the
RestDocumentationContext that should be used during placeholder
resolution. |
java.lang.String |
resolvePlaceholder(java.lang.String placeholderName) |
public RestDocumentationContextPlaceholderResolver(RestDocumentationContext context)
context
.context
- the context to usepublic java.lang.String resolvePlaceholder(java.lang.String placeholderName)
resolvePlaceholder
in interface org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver
protected final java.lang.String camelCaseToKebabCase(java.lang.String string)
string
from camelCase to kebab-case.string
- the stringprotected final java.lang.String camelCaseToSnakeCase(java.lang.String string)
string
from camelCase to snake_case.string
- the stringprotected final RestDocumentationContext getContext()
RestDocumentationContext
that should be used during placeholder
resolution.