|
32 | 32 | class ModulithMetadataUnitTest {
|
33 | 33 |
|
34 | 34 | @Test
|
35 |
| - public void inspectsModulithAnnotation() throws Exception { |
| 35 | + void inspectsModulithAnnotation() throws Exception { |
36 | 36 |
|
37 | 37 | Stream.of(ModulithAnnotated.class, ModuliticAnnotated.class) //
|
38 | 38 | .map(ModulithMetadata::of) //
|
39 | 39 | .forEach(it -> {
|
40 | 40 |
|
41 | 41 | assertThat(it.getBasePackages()).containsExactly("org.springframework.modulith.core", "com.acme.foo");
|
42 |
| - assertThat(it.getSharedModuleNames()).containsExactly("shared.module"); |
| 42 | + assertThat(it.getSharedModuleIdentifiers()) |
| 43 | + .extracting(ApplicationModuleIdentifier::toString) |
| 44 | + .containsExactly("shared.module"); |
43 | 45 | assertThat(it.getSystemName()).hasValue("systemName");
|
44 | 46 | assertThat(it.useFullyQualifiedModuleNames()).isTrue();
|
45 | 47 | });
|
46 | 48 | }
|
47 | 49 |
|
48 | 50 | @Test
|
49 |
| - public void usesDefaultsIfModulithAnnotationsAreMissing() { |
| 51 | + void usesDefaultsIfModulithAnnotationsAreMissing() { |
50 | 52 |
|
51 | 53 | ModulithMetadata metadata = ModulithMetadata.of(SpringBootApplicationAnnotated.class);
|
52 | 54 |
|
53 | 55 | assertThat(metadata.getBasePackages()).contains("org.springframework.modulith.core");
|
54 |
| - assertThat(metadata.getSharedModuleNames()).isEmpty(); |
| 56 | + assertThat(metadata.getSharedModuleIdentifiers()).isEmpty(); |
55 | 57 | assertThat(metadata.getSystemName()).hasValue(SpringBootApplicationAnnotated.class.getSimpleName());
|
56 | 58 | assertThat(metadata.useFullyQualifiedModuleNames()).isFalse();
|
57 | 59 | }
|
58 | 60 |
|
59 | 61 | @Test
|
60 |
| - public void rejectsTypeNotAnnotatedWithEitherModulithAnnotationOrSpringBootApplication() { |
| 62 | + void rejectsTypeNotAnnotatedWithEitherModulithAnnotationOrSpringBootApplication() { |
61 | 63 |
|
62 | 64 | assertThatExceptionOfType(IllegalArgumentException.class) //
|
63 | 65 | .isThrownBy(() -> ModulithMetadata.of(Unannotated.class)) //
|
| 66 | + .withMessageContaining(Unannotated.class.getSimpleName()) // |
64 | 67 | .withMessageContaining(Modulith.class.getSimpleName()) //
|
65 | 68 | .withMessageContaining(Modulithic.class.getSimpleName()) //
|
66 | 69 | .withMessageContaining(SpringBootApplication.class.getSimpleName());
|
|
0 commit comments