junit-team/junit5 · error · ConversionException

Failed to convert String "${url}" to type java.net.URL

Error message

Failed to convert String "${url}" to type java.net.URL

What it means

Error "Failed to convert String "${url}" to type java.net.URL" thrown in junit-team/junit5.

Source

Thrown at junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToCommonJavaTypesConverter.java:60

	@Override
	public boolean canConvertTo(Class<?> targetType) {
		return CONVERTERS.containsKey(targetType);
	}

	@Override
	public Object convert(String source, Class<?> targetType) throws Exception {
		Function<String, ?> converter = Preconditions.notNull(CONVERTERS.get(targetType),
			() -> "No registered converter for %s".formatted(targetType.getName()));
		return converter.apply(source);
	}

	private static URL toURL(String url) {
		try {
			return URI.create(url).toURL();
		}
		catch (MalformedURLException ex) {
			throw new ConversionException("Failed to convert String \"" + url + "\" to type java.net.URL", ex);
		}
	}

}

View on GitHub (pinned to 956246301e)

When it happens

Trigger: Thrown at junit-platform-commons/src/main/java/org/junit/platform/commons/support/conversion/StringToCommonJavaTypesConverter.java:60 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of junit-team/junit5@956246301e (2026-08-04). Data as JSON: /data/errors/33c44df8da6292ca.json. Report an issue: GitHub.