2222@ DisplayName ("EnvUtil 테스트" )
2323class EnvUtilTest {
2424
25- private static final String ENV_FILE_PATH = "src/main /resources/.env" ;
25+ private static final String ENV_FILE_PATH = "src/test /resources/.env" ;
2626
2727 @ BeforeAll
2828 static void setUp () throws IOException {
2929 String content = """
3030 SLACK_WEBHOOK_CREW_DEV_BE=https://hooks.slack.com/services/crew/dev/be
3131 SLACK_WEBHOOK_APP_PROD_FE=https://hooks.slack.com/services/app/prod/fe
3232 """ ;
33- Files .createDirectories (Paths .get ("src/main /resources" ));
33+ Files .createDirectories (Paths .get ("src/test /resources" ));
3434 Files .write (Paths .get (ENV_FILE_PATH ), content .getBytes ());
3535 }
3636
@@ -43,7 +43,7 @@ static void tearDown() throws IOException {
4343 @ Test
4444 void testGetWebhookUrl_valid () {
4545 String expectedUrl = "https://hooks.slack.com/services/crew/dev/be" ;
46- String actualUrl = EnvUtil .getWebhookUrl ("slack" , "crew" , "dev" , "be" );
46+ String actualUrl = TestEnvUtil .getWebhookUrl ("slack" , "crew" , "dev" , "be" );
4747
4848 assertEquals (expectedUrl , actualUrl );
4949 }
@@ -52,7 +52,7 @@ void testGetWebhookUrl_valid() {
5252 @ Test
5353 void testGetWebhookUrl_notFound () {
5454 WebhookUrlNotFoundException exception = assertThrows (WebhookUrlNotFoundException .class , () ->
55- EnvUtil .getWebhookUrl ("slack" , "crew" , "prod" , "be" )
55+ TestEnvUtil .getWebhookUrl ("slack" , "crew" , "prod" , "be" )
5656 );
5757
5858 assertTrue (exception .getMessage ().contains ("Webhook URL을 찾을 수 없습니다." ));
@@ -62,7 +62,7 @@ void testGetWebhookUrl_notFound() {
6262 @ Test
6363 void testGetWebhookUrl_unsupportedServiceType () {
6464 assertThrows (UnsupportedServiceTypeException .class , () ->
65- EnvUtil .getWebhookUrl ("telegram" , "crew" , "dev" , "be" )
65+ TestEnvUtil .getWebhookUrl ("telegram" , "crew" , "dev" , "be" )
6666 );
6767 }
6868
@@ -71,7 +71,7 @@ void testGetWebhookUrl_unsupportedServiceType() {
7171 @ MethodSource ("provideNullParameters" )
7272 void testGetWebhookUrl_withNullParameters_shouldThrow (String service , String team , String stage , String type ) {
7373 assertThrows (InvalidEnvParameterException .class , () ->
74- EnvUtil .getWebhookUrl (service , team , stage , type )
74+ TestEnvUtil .getWebhookUrl (service , team , stage , type )
7575 );
7676 }
7777
@@ -87,12 +87,12 @@ void testGetWebhookUrl_withNullParameters_shouldThrow(String service, String tea
8787 })
8888 void testGetWebhookUrl_caseInsensitive (String service , String team , String stage , String type ) {
8989 if (team .equalsIgnoreCase ("app" )) {
90- String actualUrl = EnvUtil .getWebhookUrl (service , team , stage , type );
90+ String actualUrl = TestEnvUtil .getWebhookUrl (service , team , stage , type );
9191 assertEquals ("https://hooks.slack.com/services/app/prod/fe" , actualUrl );
9292 return ;
9393 }
9494
95- String actualUrl = EnvUtil .getWebhookUrl (service , team , stage , type );
95+ String actualUrl = TestEnvUtil .getWebhookUrl (service , team , stage , type );
9696 assertEquals ("https://hooks.slack.com/services/crew/dev/be" , actualUrl );
9797 }
9898 private static Stream <Arguments > provideNullParameters () {
0 commit comments