Polishing

This commit is contained in:
Juergen Hoeller 2023-12-12 12:40:04 +01:00
parent 6dcba4de2c
commit 240a75f313
2 changed files with 9 additions and 10 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2023 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -44,7 +44,6 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar;
* public MyService myService() { * public MyService myService() {
* return new MyService(); * return new MyService();
* } * }
*
* }</pre> * }</pre>
* *
* <p>If the configuration class above is processed, {@code MyHints} will be * <p>If the configuration class above is processed, {@code MyHints} will be

View File

@ -132,16 +132,16 @@ class GenericApplicationContextTests {
assertThat(context.getBean(String.class)).isSameAs(context.getBean("testBean")); assertThat(context.getBean(String.class)).isSameAs(context.getBean("testBean"));
assertThat(context.getAutowireCapableBeanFactory().getBean(String.class)) assertThat(context.getAutowireCapableBeanFactory().getBean(String.class))
.isSameAs(context.getAutowireCapableBeanFactory().getBean("testBean")); .isSameAs(context.getAutowireCapableBeanFactory().getBean("testBean"));
context.close(); context.close();
assertThatIllegalStateException() assertThatIllegalStateException()
.isThrownBy(() -> context.getBean(String.class)); .isThrownBy(() -> context.getBean(String.class));
assertThatIllegalStateException() assertThatIllegalStateException()
.isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean(String.class)); .isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean(String.class));
assertThatIllegalStateException() assertThatIllegalStateException()
.isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean("testBean")); .isThrownBy(() -> context.getAutowireCapableBeanFactory().getBean("testBean"));
} }
@Test @Test
@ -287,8 +287,8 @@ class GenericApplicationContextTests {
// java.nio.file.InvalidPathException: Illegal char <:> at index 4: ping:foo // java.nio.file.InvalidPathException: Illegal char <:> at index 4: ping:foo
if (resourceLoader instanceof FileSystemResourceLoader && OS.WINDOWS.isCurrentOs()) { if (resourceLoader instanceof FileSystemResourceLoader && OS.WINDOWS.isCurrentOs()) {
assertThatExceptionOfType(InvalidPathException.class) assertThatExceptionOfType(InvalidPathException.class)
.isThrownBy(() -> context.getResource(pingLocation)) .isThrownBy(() -> context.getResource(pingLocation))
.withMessageContaining(pingLocation); .withMessageContaining(pingLocation);
} }
else { else {
resource = context.getResource(pingLocation); resource = context.getResource(pingLocation);
@ -303,8 +303,8 @@ class GenericApplicationContextTests {
assertThat(resource).isInstanceOf(FileUrlResource.class); assertThat(resource).isInstanceOf(FileUrlResource.class);
resource = context.getResource(pingLocation); resource = context.getResource(pingLocation);
assertThat(resource).asInstanceOf(type(ByteArrayResource.class)) assertThat(resource).asInstanceOf(type(ByteArrayResource.class))
.extracting(bar -> new String(bar.getByteArray(), UTF_8)) .extracting(bar -> new String(bar.getByteArray(), UTF_8))
.isEqualTo("pong:foo"); .isEqualTo("pong:foo");
} }
@Test @Test