Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit c84c057

Browse files
committed
Upgrade AppConfigTest.java
1 parent 45c1996 commit c84c057

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

hello-application-context/src/test/java/com/bobocode/AppConfigTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ public void testComponentScanIsEnabled() {
5757
@Test
5858
public void testComponentScanPackagesAreSpecified() {
5959
ComponentScan componentScan = AppConfig.class.getAnnotation(ComponentScan.class);
60-
61-
assertThat(componentScan.basePackages(), arrayContainingInAnyOrder("com.bobocode.dao", "com.bobocode.service"));
60+
String[] packages = componentScan.basePackages();
61+
if (packages.length == 0) {
62+
packages = componentScan.value();
63+
}
64+
assertThat(packages, arrayContainingInAnyOrder("com.bobocode.dao", "com.bobocode.service"));
6265
}
6366

6467
@Test

0 commit comments

Comments
 (0)