Skip to content

Commit

Permalink
upgraded to latest version of Kotlin 1.3.50
Browse files Browse the repository at this point in the history
  • Loading branch information
sunitparekh committed Oct 27, 2019
1 parent 063f87f commit a46dc8c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*.iml
target/**
.DS_Store
dataanon.log
dataanon.log
data/
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.dataanon</groupId>
<artifactId>data-anon</artifactId>
<version>0.9.7</version>
<version>0.9.8</version>
<packaging>jar</packaging>

<name>data-anon</name>
Expand All @@ -18,8 +18,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kotlin.version>1.3.0</kotlin.version>
<version.jacoco>0.8.2</version.jacoco>
<kotlin.version>1.3.50</kotlin.version>
<version.jacoco>0.8.4</version.jacoco>
</properties>

<scm>
Expand Down Expand Up @@ -81,7 +81,7 @@
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
<version>3.2.2.RELEASE</version>
<version>3.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
Expand All @@ -96,25 +96,25 @@
<dependency>
<groupId>io.kotlintest</groupId>
<artifactId>kotlintest-runner-junit5</artifactId>
<version>3.1.10</version>
<version>3.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.197</version>
<version>1.4.200</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.5</version>
<version>42.2.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.dokka</groupId>
<artifactId>dokka-maven-plugin</artifactId>
<version>0.9.17</version>
<version>0.9.18</version>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions src/test/kotlin/com/github/dataanon/Matchers.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
package com.github.dataanon

import io.kotlintest.Matcher
import io.kotlintest.Result
import io.kotlintest.MatcherResult


interface Matchers {

fun <T: Comparable<T>> beIn(range: ClosedRange<T>) = object : Matcher<T> {
override fun test(value: T) = Result(value in range, "$value not in the expected range $range")
override fun test(value: T) = MatcherResult(value in range, "$value not in the expected range $range","$value not in the expected range $range")
}

fun <T> beIn(values: Collection<T>) = object : Matcher<T> {
override fun test(value: T) = Result(values.contains(value), "$value not in the collection $values")
override fun test(value: T) = MatcherResult(values.contains(value), "$value not in the collection $values","$value not in the collection $values")
}

fun notMatches(regex: Regex) = object : Matcher<String> {
override fun test(value: String) = Result(!value.contains(regex), "$value matches $regex")
override fun test(value: String) = MatcherResult(!value.contains(regex), "$value matches $regex","$value matches $regex")
}

fun contains(str: String) = object : Matcher<String> {
override fun test(value: String) = Result(value.contains(str), "$value does not contain $str")
override fun test(value: String) = MatcherResult(value.contains(str), "$value does not contain $str","$value does not contain $str")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ class SpecialFeaturesIntegrationTest : FunSpec() {

val errors = DataAnonTestLogHandler.records.filter { it.level.intValue() > Level.INFO.intValue() }
errors.size shouldBe 6
errors[0].message should haveSubstring("Value too long for column \"GENRE VARCHAR2(10)\"")
errors[1].message should haveSubstring("Value too long for column \"GENRE VARCHAR2(10)\"")
errors[2].message should haveSubstring("Value too long for column \"GENRE VARCHAR2(10)\"")
errors[3].message should haveSubstring("Value too long for column \"GENRE VARCHAR2(10)\"")
errors[0].message should haveSubstring("'Really Long Genre To be fail 1' (30)")
errors[1].message should haveSubstring("'Really Long Genre To be fail 2' (30)")
errors[2].message should haveSubstring("'Really Long Genre To be fail 3' (30)")
errors[3].message should haveSubstring("'Really Long Genre To be fail 4' (30)")
errors[4].message should haveSubstring("Total number of errors occurred is 4 for table MOVIES exceeds allowed 3")
errors[5].message should haveSubstring("Too many errors while processing table MOVIES. Exceeds 3 errors hence terminating table processing.")

Expand Down

0 comments on commit a46dc8c

Please sign in to comment.