Added a guard to point to a missing type in YAML

This commit is contained in:
Marcin Grzejszczak
2018-04-03 21:25:06 +02:00
parent bf19d06329
commit 482f000f72
3 changed files with 11 additions and 1 deletions

View File

@@ -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 + '\'' + '}';
}
}

View File

@@ -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);

View File

@@ -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)
}