-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle-exceed-column-limit amendments 1
- Loading branch information
Showing
4 changed files
with
95 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
modules/core/src/test/scala/com.snowplowanalytics.snowplow.bigquery/AlertSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2013-present Snowplow Analytics Ltd. All rights reserved. | ||
* | ||
* This software is made available by Snowplow Analytics, Ltd., under the terms of the Snowplow | ||
* Limited Use License Agreement, Version 1.0 located at | ||
* https://docs.snowplow.io/limited-use-license-1.0 BY INSTALLING, DOWNLOADING, ACCESSING, USING OR | ||
* DISTRIBUTING ANY PORTION OF THE SOFTWARE, YOU AGREE TO THE TERMS OF SUCH LICENSE AGREEMENT. | ||
*/ | ||
package com.snowplowanalytics.snowplow.bigquery | ||
|
||
import org.specs2.Specification | ||
|
||
class AlertSpec extends Specification { | ||
|
||
def is = s2""" | ||
An Alert should: | ||
Generate a message describing an exception and any nested cause $e1 | ||
Collapse messages if a cause's message contains the parent exception's message $e2 | ||
Collapse messages if a parent exception's message contains the cause's message $e3 | ||
""" | ||
|
||
def e1 = { | ||
val e1 = new RuntimeException("original cause") | ||
val e2 = new RuntimeException("middle cause", e1) | ||
val e3 = new RuntimeException("final error", e2) | ||
|
||
val alert = Alert.FailedToCreateEventsTable(e3) | ||
|
||
val expected = "Failed to create events table: final error: middle cause: original cause" | ||
|
||
Alert.getMessage(alert) must beEqualTo(expected) | ||
} | ||
|
||
def e2 = { | ||
val e1 = new RuntimeException("This happened: original cause") | ||
val e2 = new RuntimeException("original cause", e1) | ||
|
||
val alert = Alert.FailedToCreateEventsTable(e2) | ||
|
||
val expected = "Failed to create events table: This happened: original cause" | ||
|
||
Alert.getMessage(alert) must beEqualTo(expected) | ||
} | ||
|
||
def e3 = { | ||
val e1 = new RuntimeException("original cause") | ||
val e2 = new RuntimeException("This happened: original cause", e1) | ||
|
||
val alert = Alert.FailedToCreateEventsTable(e2) | ||
|
||
val expected = "Failed to create events table: This happened: original cause" | ||
|
||
Alert.getMessage(alert) must beEqualTo(expected) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters