junit-team/junit5 · error · JUnitException

No TestEngine ID matched the following include EngineFilters

Error message

No TestEngine ID matched the following include EngineFilters: %s.\nPlease fix/remove the filter or add the engine.\n%s

What it means

EngineFilterer.checkNoUnmatchedIncludeFilter runs after all engines are checked: if any include EngineFilter named an engine id that no registered TestEngine provided, it throws a JUnitException listing the unmatched ids plus a state description. This prevents silently running zero tests because of a typo'd engine id.

Solutions

  1. Read the message: it lists unmatched ids and the actually-available engine ids - correct the typo or add the dependency.
  2. Ensure the engine artifact is on the classpath (e.g. add org.junit.jupiter:junit-jupiter-engine).
  3. Remove the includeEngines filter if you want all available engines, or align include/exclude filters so the included engine is not also excluded.

Example fix

// before
request().filters(includeEngines("jupiter")).build(); // typo -> throws
// after
request().filters(includeEngines("junit-jupiter")).build();
Defensive patterns

Strategy: validation

Validate before calling

// Verify engine ids exist before applying include filters
Set<String> available = testEngines.stream().map(TestEngine::getId).collect(toSet());
for (String id : requestedIncludeIds) {
    if (!available.contains(id)) throw new IllegalArgumentException("unknown engine id: " + id);
}

Type guard

static boolean engineIdKnown(Iterable<TestEngine> engines, String id) {
    for (TestEngine e : engines) if (e.getId().equals(id)) return true;
    return false;
}

Try / catch

try {
    launcher.execute(request);
} catch (JUnitException e) {
    if (e.getMessage().contains("No TestEngine ID matched")) {
        // read available ids from message, fix filter, retry
    }
}

Prevention

When it happens

Trigger: Adding an include EngineFilter (LauncherDiscoveryRequestBuilder.filters(includeEngines("xxx"))) where 'xxx' is not the id of any TestEngine on the classpath/registry. Also via the junit.platform.launcher.includeEngines system/launcher property pointing at a non-existent engine.

Common situations: Typo in engine id (e.g. 'jupiter' instead of 'junit-jupiter'); the requested engine is not on the classpath (missing junit-jupiter-engine dependency); using includeEngines on a minimal classpath that only has platform; an engine was excluded by another filter so its id never matches.

Related errors


AI-assisted analysis of junit-team/junit5@f070c699a0 (2026-08-11). Data as JSON: /api/errors/1615f25734bcb47a. Report an issue: GitHub.

Appendix: source

Thrown at junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/EngineFilterer.java:67

		checkedTestEngines.put(testEngine, excluded);
		return excluded;
	}

	void performSanityChecks() {
		checkNoUnmatchedIncludeFilter();
		warnIfAllEnginesExcluded();
	}

	private void warnIfAllEnginesExcluded() {
		if (!checkedTestEngines.isEmpty() && checkedTestEngines.values().stream().allMatch(excluded -> excluded)) {
			logger.warn(() -> "All TestEngines were excluded by EngineFilters.\n" + getStateDescription());
		}
	}

	private void checkNoUnmatchedIncludeFilter() {
		SortedSet<String> unmatchedEngineIdsOfIncludeFilters = getUnmatchedEngineIdsOfIncludeFilters();
		if (!unmatchedEngineIdsOfIncludeFilters.isEmpty()) {
			throw new JUnitException("No TestEngine ID matched the following include EngineFilters: "
					+ unmatchedEngineIdsOfIncludeFilters + ".\n" //
					+ "Please fix/remove the filter or add the engine.\n" //
					+ getStateDescription());
		}
	}

	private SortedSet<String> getUnmatchedEngineIdsOfIncludeFilters() {
		Set<String> checkedTestEngineIds = checkedTestEngines.keySet().stream() //
				.map(TestEngine::getId) //
				.collect(toSet());
		return engineFilters.stream() //
				.filter(EngineFilter::isIncludeFilter) //
				.map(EngineFilter::getEngineIds) //
				.flatMap(Collection::stream) //
				.filter(id -> !checkedTestEngineIds.contains(id)) //
				.collect(toCollection(TreeSet::new));
	}

View on GitHub (pinned to f070c699a0)