diff --git a/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java b/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java index c787f4f7..ea4deb9e 100644 --- a/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java +++ b/domain/src/test/java/org/depromeet/spot/domain/media/MediaTest.java @@ -8,7 +8,7 @@ class MediaTest { @Test - public void url이_없으면_미디어를_생성할_수_없다() { + public void url이_공백이면_미디어를_생성할_수_없다() { // given final String url = ""; final String fileName = "file"; @@ -20,7 +20,31 @@ class MediaTest { } @Test - public void fileName이_없으면_미디어를_생성할_수_없다() { + public void url이_null이면_미디어를_생성할_수_없다() { + // given + final String url = null; + final String fileName = "file"; + + // when + // then + assertThatThrownBy(() -> new Media(url, fileName)) + .isInstanceOf(InvalidMediaException.class); + } + + @Test + public void fileName이_공백이면_미디어를_생성할_수_없다() { + // given + final String url = "url"; + final String fileName = ""; + + // when + // then + assertThatThrownBy(() -> new Media(url, fileName)) + .isInstanceOf(InvalidMediaException.class); + } + + @Test + public void fileName이_null이면_미디어를_생성할_수_없다() { // given final String url = "url"; final String fileName = "";