Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,22 @@ package object licensing {
/** Testable variant: days since expiry relative to a given instant. */
def daysSinceExpiryAt(now: java.time.Instant): Option[Long] =
expiresAt.map(exp => -daysBetween(now, exp))

def products: Set[ProductType] = features.collect { case p: ProductType => p }
}

object LicenseKey {
val Community: LicenseKey = LicenseKey(
id = "community",
licenseType = LicenseType.Community,
features =
Set(Feature.MaterializedViews, Feature.JdbcDriver, Feature.FlightSql, Feature.Federation),
features = Set(
Feature.MaterializedViews,
Feature.JdbcDriver,
Feature.AdbcDriver,
Feature.FlightSql,
Feature.Federation,
Feature.Repl
),
expiresAt = None,
quota = Some(Quota.Community)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ class LicenseManagerSpec extends AnyFlatSpec with Matchers {
manager.hasFeature(Feature.Federation) shouldBe true
}

it should "not include AdbcDriver" in {
manager.hasFeature(Feature.AdbcDriver) shouldBe false
it should "include AdbcDriver" in {
manager.hasFeature(Feature.AdbcDriver) shouldBe true
}

it should "not include Repl" in {
manager.hasFeature(Feature.Repl) shouldBe false
it should "include Repl" in {
manager.hasFeature(Feature.Repl) shouldBe true
}

it should "not include UnlimitedResults" in {
Expand Down
Loading