-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#99: DBEngine requirement removed from DBSchema. Fixes #99. #100
Conversation
JaCoCo code coverage report - scala 2.11.12
|
JaCoCo code coverage report - scala 2.12.17
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- pulled
- built
- code review
- code coverage - proposed 2 tests by comment.
@@ -18,27 +18,17 @@ package za.co.absa.fadb | |||
import org.scalatest.funsuite.AnyFunSuite | |||
import za.co.absa.fadb.naming.implementations.SnakeCaseNaming.Implicits.namingConvention | |||
|
|||
import scala.concurrent.{ExecutionContext, Future} | |||
|
|||
class DBSchemaSuite extends AnyFunSuite { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to add new tests to improve coverage:
test("schema name with naming convention without override") {
object LowerCaseNamingConvention extends NamingConvention {
def stringPerConvention(original: String): String = original.toLowerCase
}
class Bar extends DBSchema(LowerCaseNamingConvention, null)
val schema = new Bar
assert(schema.schemaName == "bar") // Assuming the naming convention converts "Bar" to "bar"
}
test("schema name with naming convention with override") {
object LowerCaseNamingConvention extends NamingConvention {
def stringPerConvention(original: String): String = original.toLowerCase
}
class Bar extends DBSchema(LowerCaseNamingConvention, "bar")
val schema = new Bar
assert(schema.schemaName == "bar")
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @miroslavpojer. Will add it to the codebase. I think also that once we merge this code we should revisit existing projects utilizing this library, fix it's usage there and then update examples so users of the library have updated examples as part of this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
object LowerCaseNamingConvention extends NamingConvention { | ||
def stringPerConvention(original: String): String = original.toLowerCase | ||
} | ||
class Bar extends DBSchema(LowerCaseNamingConvention, "bar") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I would chose something other than bar, just to distinguish it? :) I mean, so that the schema name is actually overridden
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost approved, found a tiny thing. Since originally there was a dependency on the DBEngine, but it wasn't really used here, I like the changes
This PR has become obsolete. |
DBEngine requirement was removed from the DBSchema class.