Skip to content

Commit e14ca7b

Browse files
committed
style: Rename exception message
1 parent 6a385dc commit e14ca7b

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/main/kotlin/com/fnakhsan/toprotobufconverter/core/PluginException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class KotlinStructureException :
1919
PluginException("Kotlin exception:", "incorrect structure, try on kotlin data class")
2020

2121
class WrongFileNameException :
22-
PluginException("Wrong file name:", "Files should be named with lower_snake_case")
22+
PluginException("Wrong file name:", "Files cannot be empty and must be named with lower_snake_case")
2323

2424
class PathException :
2525
PluginException(

src/test/kotlin/com/fnakhsan/toprotobufconverter/core/PluginExceptionTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ internal class PluginExceptionTest {
1111
kotlin.test.assertEquals("File creation exception:", exception.header)
1212
}
1313

14+
@Test
15+
fun check_SourceException() {
16+
val exception = SourceException()
17+
kotlin.test.assertEquals(
18+
"You should choose another language to be converted into Protocol Buffers Schema files, before call this plugin",
19+
exception.message
20+
)
21+
kotlin.test.assertEquals("Language is not available:", exception.header)
22+
}
23+
1424
@Test
1525
fun check_KotlinStructureException() {
1626
val exception = KotlinStructureException()
@@ -21,7 +31,7 @@ internal class PluginExceptionTest {
2131
@Test
2232
fun check_WrongFileNameException() {
2333
val exception = WrongFileNameException()
24-
kotlin.test.assertEquals("Files should be named with lower_snake_case", exception.message)
34+
kotlin.test.assertEquals("Files cannot be empty and must be named with lower_snake_case", exception.message)
2535
kotlin.test.assertEquals("Wrong file name:", exception.header)
2636
}
2737
}

src/test/kotlin/com/fnakhsan/toprotobufconverter/listeners/GenerateActionListenerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ internal class GenerateActionListenerTest {
4444
fun setUp() = MockKAnnotations.init(this, relaxUnitFun = true)
4545

4646
@Test
47-
fun onActionHandled_withError() {
47+
fun actionPerformed_withError() {
4848
every { messageConversionHelper.validateFileName(any()) } throws exception
4949
listener.actionPerformed(actionEvent)
5050
verify { messageDelegate.onPluginExceptionHandled(exception) }

0 commit comments

Comments
 (0)