Skip to content

Commit

Permalink
fixed explicit subject compatibility not being set
Browse files Browse the repository at this point in the history
  • Loading branch information
domnikl committed Dec 27, 2021
1 parent e00ceb4 commit ba94400
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class SchemaRegistryClient(private val client: CachedSchemaRegistryClient) {
ERROR_CODE_SUBJECT_NOT_FOUND -> null
ERROR_CODE_VERSION_NOT_FOUND -> null
ERROR_CODE_SCHEMA_NOT_FOUND -> null
ERROR_CODE_SUBJECT_LEVEL_COMPATIBILITY_NOT_CONFIGURED -> null
else -> throw e
}
}
Expand All @@ -98,6 +99,7 @@ class SchemaRegistryClient(private val client: CachedSchemaRegistryClient) {
private const val ERROR_CODE_SUBJECT_NOT_FOUND = 40401
private const val ERROR_CODE_VERSION_NOT_FOUND = 40402
private const val ERROR_CODE_SCHEMA_NOT_FOUND = 40403
private const val ERROR_CODE_SUBJECT_LEVEL_COMPATIBILITY_NOT_CONFIGURED = 40408
private const val ERROR_CODE_UNPROCESSABLE_ENTITY = 422
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ class SchemaRegistryClientTest {
)
}

@Test
fun `will return Compatibility None if not set explicitly`() {
every { client.getCompatibility("foo") } throws RestClientException("", 404, 40408)

assertEquals(
Compatibility.NONE,
wrapper.compatibility("foo")
)
}

@Test
fun `can get compatibility if none is set`() {
every { client.getCompatibility("foo") } throws RestClientException("", 404, 40403)
Expand Down

0 comments on commit ba94400

Please sign in to comment.