Added a guard to point to a missing type in YAML
This commit is contained in:
@@ -50,4 +50,9 @@ public class BaseClassMapping {
|
||||
result = 31 * result + (this.baseClassFQN != null ? this.baseClassFQN.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override public String toString() {
|
||||
return "BaseClassMapping{" + "contractPackageRegex='" + this.contractPackageRegex
|
||||
+ '\'' + ", baseClassFQN='" + this.baseClassFQN + '\'' + '}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,8 @@ public class GenerateTestsMojo extends AbstractMojo {
|
||||
+ " added.");
|
||||
getLog().info("Using [" + config.getBaseClassForTests()
|
||||
+ "] as base class for test classes, [" + config.getBasePackageForTests() + "] as base "
|
||||
+ "package for tests, [" + config.getPackageWithBaseClasses() + "] as package with base classes");
|
||||
+ "package for tests, [" + config.getPackageWithBaseClasses() + "] as package with "
|
||||
+ "base classes, base class mappings " + this.baseClassMappings);
|
||||
}
|
||||
try {
|
||||
TestGenerator generator = new TestGenerator(config);
|
||||
|
||||
@@ -293,6 +293,8 @@ class YamlContractConverter implements ContractConverter<List<YamlContract>> {
|
||||
case StubMatcherType.by_equality:
|
||||
value = byEquality()
|
||||
break
|
||||
default:
|
||||
throw new UnsupportedOperationException("The type [" + matcher.type + "] is unsupported. Hint: If you're using <predefined> remember to pass <type: by_regex>")
|
||||
}
|
||||
jsonPath(matcher.path, value)
|
||||
}
|
||||
@@ -349,6 +351,8 @@ class YamlContractConverter implements ContractConverter<List<YamlContract>> {
|
||||
case TestMatcherType.by_null:
|
||||
value = byNull()
|
||||
break
|
||||
default:
|
||||
throw new UnsupportedOperationException("The type [" + testMatcher.type + "] is unsupported. Hint: If you're using <predefined> remember to pass <type: by_regex>")
|
||||
}
|
||||
jsonPath(testMatcher.path, value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user