Browse Source

Reinstate testing for NoSuchMethodFailureAnalyzer parsing on OpenJ9

Closes gh-28785
pull/32180/head
Scott Frederick 3 years ago
parent
commit
ada2450483
  1. 18
      spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java

18
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/NoSuchMethodFailureAnalyzerTests.java

@ -54,6 +54,24 @@ class NoSuchMethodFailureAnalyzerTests { @@ -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<ClassDescriptor> 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();

Loading…
Cancel
Save