Skip to content

Commit

Permalink
#2 - Feat: dev, test InitData 기반 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
ahah525 committed Oct 17, 2022
1 parent b94b3b9 commit 9502898
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
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();
};
}
}
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() {

}
}
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();
};
}
}

0 comments on commit 9502898

Please sign in to comment.