Skip to content

Commit b44943b

Browse files
committed
tst
1 parent dcb092a commit b44943b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/CodeWhispererEditorUtilTest.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import org.assertj.core.api.Assertions.assertThat
1111
import org.junit.Before
1212
import org.junit.Rule
1313
import org.junit.Test
14+
import org.junit.jupiter.api.assertThrows
1415
import org.junit.jupiter.params.ParameterizedTest
1516
import org.junit.jupiter.params.provider.ValueSource
1617
import software.aws.toolkits.jetbrains.services.codewhisperer.CodeWhispererTestUtil.leftContext_success_Iac
@@ -108,10 +109,14 @@ class CodeWhispererEditorUtilTest {
108109

109110
@Test
110111
fun `isSupportedJsonFormat should return false due to no match`() {
111-
var result = CodeWhispererEditorUtil.isSupportedJsonFormat("foo.json", "", CodeWhispererJson.INSTANCE)
112+
val result = CodeWhispererEditorUtil.isSupportedJsonFormat("foo.json", "", CodeWhispererJson.INSTANCE)
112113
assertThat(result).isEqualTo(false)
114+
}
113115

114-
result = CodeWhispererEditorUtil.isSupportedJsonFormat("package.json", "", CodeWhispererYaml.INSTANCE)
115-
assertThat(result).isEqualTo(false)
116+
@Test
117+
fun `isSupportedJsonFormat should throw assertion error if language is not JSON`() {
118+
assertThrows<AssertionError> {
119+
CodeWhispererEditorUtil.isSupportedJsonFormat("foo.json", "", CodeWhispererYaml.INSTANCE)
120+
}
116121
}
117122
}

0 commit comments

Comments
 (0)