Commit 54e64f44 authored by Martti Käärik's avatar Martti Käärik
Browse files

Don't crash on missing parameter mappings. Instead, use parameter name and add...

Don't crash on missing parameter mappings. Instead, use parameter name and add comment that it is unmapped.
parent 92d28278
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -1946,6 +1946,7 @@ public class JUnitTestGenerator extends Renderer {

		} else {
			ParameterMapping mapping = getParameterMapping(p);
			if (mapping != null) {
				if (hasAnnotation(mapping, MAPPING_ANNOTATION_SETTER)) {
					append(mapping.getParameterURI());
					append("(");
@@ -1957,6 +1958,12 @@ public class JUnitTestGenerator extends Renderer {
					append(" = ");
					write(v, dataUseVariables);
				}
			} else {
				append(p.getName());
				append(" = ");
				write(v, dataUseVariables);
				lineComment(" Parameter not mapped");
			}
		}
	}