diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java index d445cddd83e..2d47bbda773 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java @@ -54,6 +54,24 @@ class NoSuchMethodFailureAnalyzerTests { assertThat(typeHierarchy.get(0).getLocation()).asString().contains("spring-core-5.3.12.jar"); } + @Test + void parseOpenJ9ErrorMessage() { + NoSuchMethodDescriptor descriptor = new NoSuchMethodFailureAnalyzer().getNoSuchMethodDescriptor( + "org/springframework/util/MimeType.isMoreSpecific(Lorg/springframework/util/MimeType;)Z " + + "(loaded from ...) " + + "called from class org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzerTests " + + "(loaded from ... " + + "by org.springframework.boot.testsupport.classpath.ModifiedClassPathClassLoader@e0ce6310)."); + assertThat(descriptor).isNotNull(); + assertThat(descriptor.getErrorMessage()) + .isEqualTo("org/springframework/util/MimeType.isMoreSpecific(Lorg/springframework/util/MimeType;)Z"); + assertThat(descriptor.getClassName()).isEqualTo("org.springframework.util.MimeType"); + assertThat(descriptor.getCandidateLocations().size()).isGreaterThan(1); + List typeHierarchy = descriptor.getTypeHierarchy(); + assertThat(typeHierarchy).hasSize(1); + assertThat(typeHierarchy.get(0).getLocation()).asString().contains("spring-core-5.3.12.jar"); + } + @Test void whenAMethodOnAClassIsMissingThenNoSuchMethodErrorIsAnalyzed() { Throwable failure = createFailureForMissingMethod();