Skip to content

Commit

Permalink
Use vector
Browse files Browse the repository at this point in the history
  • Loading branch information
pondzix committed Mar 25, 2024
1 parent 2f3e6be commit 722a5d1
Showing 1 changed file with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class TransformStructuredSpec extends Specification {

def onlyAtomic = {
val event = createEvent()
val batchInfo = Result(List.empty, List.empty) // no custom entities
val batchInfo = Result(Vector.empty, List.empty) // no custom entities
val expectedAtomic = List(
NamedValue("event_id", Json.fromString(eventId.toString)),
NamedValue("collector_tstamp", Json.fromString(now.toString)),
Expand All @@ -109,7 +109,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(unstruct = Some(sdj(data = json"""{ "my_string": "abc"}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))),
fields = Vector(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))),
igluFailures = List.empty
)
val expectedOutput = List(NamedValue(name = "unstruct_event_com_example_my_schema_1", value = json"""{ "my_string": "abc"}"""))
Expand All @@ -121,7 +121,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(contexts = List(sdj(data = json"""{ "my_string": "abc"}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaContexts(model = 1, subVersions = Set((0, 0)))),
fields = Vector(mySchemaContexts(model = 1, subVersions = Set((0, 0)))),
igluFailures = List.empty
)
val expectedOutput = List(
Expand All @@ -140,7 +140,7 @@ class TransformStructuredSpec extends Specification {
)

val batchInfo = Result(
fields = List(
fields = Vector(
mySchemaContexts(model = 1, subVersions = Set((0, 0))),
mySchemaContexts(model = 2, subVersions = Set((0, 0)))
),
Expand Down Expand Up @@ -169,7 +169,7 @@ class TransformStructuredSpec extends Specification {
)

val batchTypesInfo = Result(
fields = List(
fields = Vector(
mySchemaContexts(model = 1, subVersions = Set((0, 0), (1, 0)))
),
igluFailures = List.empty
Expand Down Expand Up @@ -198,7 +198,7 @@ class TransformStructuredSpec extends Specification {
tr_total = Some(12.34)
)

val batchInfo = Result(List.empty, List.empty) // no custom entities
val batchInfo = Result(Vector.empty, List.empty) // no custom entities
val expectedOutput = List(
NamedValue("app_id", json""" "myapp" """),
NamedValue("dvce_created_tstamp", json"$now"),
Expand All @@ -215,7 +215,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(unstruct = Some(sdj(data = dataWithAllTypes, key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)), schemaWithAllPossibleTypes)),
fields = Vector(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)), schemaWithAllPossibleTypes)),
igluFailures = List.empty
)
val expectedOutput = List(
Expand All @@ -232,7 +232,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(contexts = List(sdj(data = dataWithAllTypes, key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaContexts(model = 1, subVersions = Set((0, 0)), schemaWithAllPossibleTypes)),
fields = Vector(mySchemaContexts(model = 1, subVersions = Set((0, 0)), schemaWithAllPossibleTypes)),
igluFailures = List.empty
)
val expectedOutput = List(
Expand Down Expand Up @@ -264,7 +264,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent = createEvent()

val batchTypesInfo = Result(
fields = List(
fields = Vector(
mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))
),
igluFailures = List.empty
Expand All @@ -283,7 +283,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent = createEvent()

val batchTypesInfo = Result(
fields = List(
fields = Vector(
mySchemaContexts(model = 1, subVersions = Set((0, 0)))
),
igluFailures = List.empty
Expand All @@ -303,7 +303,7 @@ class TransformStructuredSpec extends Specification {
createEvent(unstruct = Some(sdj(data = json"""{ "my_string": "abc"}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))

val batchTypesInfo = Result(
fields = List.empty,
fields = Vector.empty,
igluFailures = List.empty
)
val shouldNotExist = List("unstruct_event_com_example_my_schema_1")
Expand All @@ -316,7 +316,7 @@ class TransformStructuredSpec extends Specification {
createEvent(unstruct = Some(sdj(data = json"""{ "my_string": "abc"}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))

val batchTypesInfo = Result(
fields = List(mySchemaUnstruct(model = 1, subVersions = Set((1, 0)))),
fields = Vector(mySchemaUnstruct(model = 1, subVersions = Set((1, 0)))),
igluFailures = List.empty
)

Expand All @@ -338,7 +338,7 @@ class TransformStructuredSpec extends Specification {
)

val batchTypesInfo = Result(
fields = List.empty,
fields = Vector.empty,
igluFailures = List.empty
)
val shouldNotExist = List("contexts_com_example_my_schema_1")
Expand All @@ -354,7 +354,7 @@ class TransformStructuredSpec extends Specification {
)

val batchTypesInfo = Result(
fields = List(mySchemaContexts(model = 1, subVersions = Set((1, 0)))),
fields = Vector(mySchemaContexts(model = 1, subVersions = Set((1, 0)))),
igluFailures = List.empty
)

Expand All @@ -381,7 +381,7 @@ class TransformStructuredSpec extends Specification {
ti_price_base = Some(12.3456)
)

val batchInfo = Result(List.empty, List.empty)
val batchInfo = Result(Vector.empty, List.empty)

val wrongType = FailureDetails.LoaderIgluError.WrongType(
SchemaKey("com.snowplowanalytics.snowplow", "atomic", "jsonschema", Full(1, 0, 0)),
Expand All @@ -407,7 +407,7 @@ class TransformStructuredSpec extends Specification {
ti_price_base = Some(12345678987654321.34)
)

val batchInfo = Result(List.empty, List.empty)
val batchInfo = Result(Vector.empty, List.empty)

val wrongType = FailureDetails.LoaderIgluError.WrongType(
SchemaKey("com.snowplowanalytics.snowplow", "atomic", "jsonschema", Full(1, 0, 0)),
Expand All @@ -424,7 +424,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(unstruct = Some(sdj(data = json"""{ "my_string": null}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))),
fields = Vector(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))),
igluFailures = List.empty
)

Expand All @@ -441,7 +441,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(unstruct = Some(sdj(data = json"""{ "my_string": 123}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))),
fields = Vector(mySchemaUnstruct(model = 1, subVersions = Set((0, 0)))),
igluFailures = List.empty
)

Expand All @@ -458,7 +458,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(contexts = List(sdj(data = json"""{ "my_string": null}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaContexts(model = 1, subVersions = Set((0, 0)))),
fields = Vector(mySchemaContexts(model = 1, subVersions = Set((0, 0)))),
igluFailures = List.empty
)

Expand All @@ -475,7 +475,7 @@ class TransformStructuredSpec extends Specification {
val inputEvent =
createEvent(contexts = List(sdj(data = json"""{ "my_string": 123}""", key = "iglu:com.example/mySchema/jsonschema/1-0-0")))
val batchInfo = Result(
fields = List(mySchemaContexts(model = 1, subVersions = Set((0, 0)))),
fields = Vector(mySchemaContexts(model = 1, subVersions = Set((0, 0)))),
igluFailures = List.empty
)

Expand All @@ -498,7 +498,7 @@ class TransformStructuredSpec extends Specification {
)

val batchInfo = Result(
fields = List.empty,
fields = Vector.empty,
igluFailures = List(
ColumnFailure(
TabledEntity(TabledEntity.UnstructEvent, "com.example", "mySchema", 1),
Expand Down

0 comments on commit 722a5d1

Please sign in to comment.