Skip to content

Commit

Permalink
add source and destination definition backend feature flag contexts (…
Browse files Browse the repository at this point in the history
…#6381)
  • Loading branch information
pedroslopez committed May 5, 2023
1 parent 37e700f commit 207ec2b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
40 changes: 36 additions & 4 deletions airbyte-featureflag/src/main/kotlin/Context.kt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ data class Connection(override val key: String) : Context {
}

/**
* Context for representing a source.
* Context for representing a source actor.
*
* @param [key] the unique identifying value of this source
*/
Expand All @@ -135,13 +135,13 @@ data class Source(override val key: String) : Context {
/**
* Secondary constructor
*
* @param [key] Source UUID
* @param [key] Source Actor UUID
*/
constructor(key: UUID) : this(key = key.toString())
}

/**
* Context for representing a destination.
* Context for representing a destination actor.
*
* @param [key] the unique identifying value of this destination
*/
Expand All @@ -151,7 +151,39 @@ data class Destination(override val key: String) : Context {
/**
* Secondary constructor
*
* @param [key] Destination UUID
* @param [key] Destination Actor UUID
*/
constructor(key: UUID) : this(key = key.toString())
}

/**
* Context for representing a source definition.
*
* @param [key] the unique identifying value of this source definition
*/
data class SourceDefinition(override val key: String) : Context {
override val kind = "source-definition"

/**
* Secondary constructor
*
* @param [key] SourceDefinition UUID
*/
constructor(key: UUID) : this(key = key.toString())
}

/**
* Context for representing a destination definition.
*
* @param [key] the unique identifying value of this destination definition
*/
data class DestinationDefinition(override val key: String) : Context {
override val kind = "destination-definition"

/**
* Secondary constructor
*
* @param [key] DestinationDefinition UUID
*/
constructor(key: UUID) : this(key = key.toString())
}
20 changes: 20 additions & 0 deletions airbyte-featureflag/src/test/kotlin/ContextTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,23 @@ class DestinationTest {
}
}
}

class SourceDefinitionTest {
@Test
fun `verify data`() {
SourceDefinition("source definition key").also {
assert(it.kind == "source-definition")
assert(it.key == "source definition key")
}
}
}

class DestinationDefinitionTest {
@Test
fun `verify data`() {
DestinationDefinition("destination definition key").also {
assert(it.kind == "destination-definition")
assert(it.key == "destination definition key")
}
}
}

0 comments on commit 207ec2b

Please sign in to comment.