Polishing

This commit is contained in:
Sam Brannen 2023-06-25 15:18:31 +02:00
parent 55f946c5a0
commit db17a97ce8
1 changed files with 8 additions and 7 deletions

View File

@ -84,8 +84,8 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
listeners.put("*", null);
MBeanExporter exporter = new MBeanExporter();
assertThatIllegalArgumentException().isThrownBy(() ->
exporter.setNotificationListenerMappings(listeners));
assertThatIllegalArgumentException()
.isThrownBy(() -> exporter.setNotificationListenerMappings(listeners));
}
@Test
@ -100,9 +100,10 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
exporter.setBeans(getBeanMap());
exporter.setServer(server);
exporter.setNotificationListenerMappings(listeners);
assertThatExceptionOfType(MBeanExportException.class).as("NotificationListener on a non-existent MBean").isThrownBy(() ->
start(exporter))
.satisfies(ex -> assertThat(ex.contains(InstanceNotFoundException.class)).isTrue());
assertThatExceptionOfType(MBeanExportException.class)
.as("NotificationListener on a non-existent MBean")
.isThrownBy(() -> start(exporter))
.withCauseExactlyInstanceOf(InstanceNotFoundException.class);
}
@Test
@ -165,8 +166,8 @@ public class MBeanExporterTests extends AbstractMBeanServerTests {
ObjectInstance instance = server.getObjectInstance(ObjectNameManager.getInstance("spring:mbean=true"));
assertThat(instance).isNotNull();
assertThatExceptionOfType(InstanceNotFoundException.class).isThrownBy(() ->
server.getObjectInstance(ObjectNameManager.getInstance("spring:mbean=false")));
assertThatExceptionOfType(InstanceNotFoundException.class)
.isThrownBy(() -> server.getObjectInstance(ObjectNameManager.getInstance("spring:mbean=false")));
}
}