From 9e3f3bee7140427ae43ab9ae9ec69fda7785c836 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 15 Jul 2023 14:55:26 +0200 Subject: [PATCH] Consistently throw TestContextAotException in TestContextAotGenerator See gh-30898 --- .../test/context/aot/TestContextAotGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-test/src/main/java/org/springframework/test/context/aot/TestContextAotGenerator.java b/spring-test/src/main/java/org/springframework/test/context/aot/TestContextAotGenerator.java index 3629af2d49ad..4cce32599b96 100644 --- a/spring-test/src/main/java/org/springframework/test/context/aot/TestContextAotGenerator.java +++ b/spring-test/src/main/java/org/springframework/test/context/aot/TestContextAotGenerator.java @@ -227,7 +227,7 @@ private MultiValueMap> processAheadOfTime( } catch (Exception ex) { if (this.failOnError) { - throw new IllegalStateException("Failed to generate AOT artifacts for test classes " + + throw new TestContextAotException("Failed to generate AOT artifacts for test classes " + testClasses.stream().map(Class::getName).toList(), ex); } if (logger.isDebugEnabled()) {