-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2 - Feat: dev, test InitData 기반 코드 추가
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
1Week_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/DevInitData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.example.mutbooks.app.base.initData; | ||
|
||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Configuration | ||
@Profile("dev") | ||
public class DevInitData implements InitDataBefore { | ||
@Bean | ||
CommandLineRunner initData() { | ||
return args -> { | ||
before(); | ||
}; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/InitDataBefore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.mutbooks.app.base.initData; | ||
|
||
public interface InitDataBefore { | ||
default void before() { | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...k_Mission/mutbooks/src/main/java/com/example/mutbooks/app/base/initData/TestInitData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.example.mutbooks.app.base.initData; | ||
|
||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Profile; | ||
|
||
@Configuration | ||
@Profile("test") | ||
public class TestInitData implements InitDataBefore { | ||
@Bean | ||
CommandLineRunner initData() { | ||
return args -> { | ||
before(); | ||
}; | ||
} | ||
} |