Minor refactoring - changed class name and added immutability on the headers set
This commit is contained in:
@@ -26,8 +26,8 @@ class CustomizableProperty<T, V> {
|
||||
class StringCustomizableProperty extends CustomizableProperty<String, String> {
|
||||
}
|
||||
|
||||
class NoOpCustomizableProperty<T> extends CustomizableProperty<T, T> {
|
||||
NoOpCustomizableProperty(T value) {
|
||||
class SingleTypeCustomizableProperty<T> extends CustomizableProperty<T, T> {
|
||||
SingleTypeCustomizableProperty(T value) {
|
||||
client(value)
|
||||
server(value)
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ class Headers {
|
||||
}
|
||||
|
||||
Set<Map.Entry<String, WithValuePattern>> entries() {
|
||||
//TODO: Make it immutable
|
||||
return headers.entrySet()
|
||||
return Collections.unmodifiableSet(headers.entrySet())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,11 @@ import static io.coderate.accurest.dsl.internal.DelegateHelper.delegateToClosure
|
||||
|
||||
class WithValuePattern {
|
||||
|
||||
NoOpCustomizableProperty<String> equalToJson
|
||||
NoOpCustomizableProperty<String> equalToXml
|
||||
SingleTypeCustomizableProperty<String> equalToJson
|
||||
SingleTypeCustomizableProperty<String> equalToXml
|
||||
StringCustomizableProperty matchesXPath
|
||||
NoOpCustomizableProperty<JSONCompareMode> jsonCompareMode
|
||||
NoOpCustomizableProperty<String> equalTo
|
||||
SingleTypeCustomizableProperty<JSONCompareMode> jsonCompareMode
|
||||
SingleTypeCustomizableProperty<String> equalTo
|
||||
StringCustomizableProperty contains
|
||||
StringCustomizableProperty matches
|
||||
StringCustomizableProperty doesNotMatch
|
||||
@@ -20,7 +20,7 @@ class WithValuePattern {
|
||||
// }
|
||||
//
|
||||
void equalTo(String equalTo) {
|
||||
this.equalTo = new NoOpCustomizableProperty(equalTo)
|
||||
this.equalTo = new SingleTypeCustomizableProperty(equalTo)
|
||||
}
|
||||
|
||||
// void equalToXml(String equalToXml) {
|
||||
|
||||
Reference in New Issue
Block a user