-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* new module added scalapact-scalatest-suite
- Loading branch information
jbwheatley
authored
Oct 19, 2020
1 parent
d02df52
commit cbdbb74
Showing
26 changed files
with
378 additions
and
296 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
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
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
9 changes: 9 additions & 0 deletions
9
scalapact-circe-0-13/src/main/scala/com/itv/scalapact/circe13/JsonInstances.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,9 @@ | ||
package com.itv.scalapact.circe13 | ||
|
||
import com.itv.scalapact.shared.typeclasses.{IPactReader, IPactWriter} | ||
|
||
trait JsonInstances { | ||
implicit val pactReaderInstance: IPactReader = new PactReader | ||
|
||
implicit val pactWriterInstance: IPactWriter = new PactWriter | ||
} |
12 changes: 1 addition & 11 deletions
12
scalapact-circe-0-13/src/main/scala/com/itv/scalapact/circe13/package.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 |
---|---|---|
@@ -1,13 +1,3 @@ | ||
package com.itv.scalapact | ||
|
||
import com.itv.scalapact.shared.typeclasses.{IPactReader, IPactWriter} | ||
|
||
package object circe13 { | ||
|
||
implicit val pactReaderInstance: IPactReader = | ||
new PactReader | ||
|
||
implicit val pactWriterInstance: IPactWriter = | ||
new PactWriter | ||
|
||
} | ||
package object circe13 extends JsonInstances |
9 changes: 2 additions & 7 deletions
9
scalapact-circe-0-13/src/main/scala/com/itv/scalapact/json/package.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 |
---|---|---|
@@ -1,12 +1,7 @@ | ||
package com.itv.scalapact | ||
|
||
import com.itv.scalapact.circe13.{PactReader, PactWriter} | ||
import com.itv.scalapact.shared.typeclasses.{IPactReader, IPactWriter} | ||
|
||
package object json { | ||
implicit val pactReaderInstance: IPactReader = new PactReader | ||
|
||
implicit val pactWriterInstance: IPactWriter = new PactWriter | ||
import com.itv.scalapact.circe13.JsonInstances | ||
|
||
package object json extends JsonInstances { | ||
val JsonConversionFunctions: circe13.JsonConversionFunctions.type = circe13.JsonConversionFunctions | ||
} |
12 changes: 12 additions & 0 deletions
12
scalapact-scalatest-suite/src/main/resources/log4j.properties
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,12 @@ | ||
# Root logger option | ||
log4j.rootLogger=INFO, stdout | ||
|
||
# Direct log messages to stdout | ||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
log4j.appender.stdout.Target=System.out | ||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n | ||
|
||
|
||
log4j.logger.com.github.tomakehurst=ERROR | ||
log4j.logger.org.mortbay.log=ERROR |
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,20 @@ | ||
<configuration> | ||
|
||
<appender name="STDOUT" | ||
class="ch.qos.logback.core.ConsoleAppender"> | ||
<encoder> | ||
<pattern> | ||
%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n | ||
</pattern> | ||
</encoder> | ||
</appender> | ||
|
||
<logger name="com.github.tomakehurst" level="ERROR" /> | ||
<logger name="org.mortbay" level="ERROR" /> | ||
<logger name="org.apache" level="ERROR" /> | ||
|
||
<root level="DEBUG"> | ||
<appender-ref ref="STDOUT" /> | ||
</root> | ||
|
||
</configuration> |
6 changes: 6 additions & 0 deletions
6
scalapact-scalatest-suite/src/main/scala/com/itv/scalapact/PactForgerSuite.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,6 @@ | ||
package com.itv.scalapact | ||
|
||
import com.itv.scalapact.circe13.JsonInstances | ||
import com.itv.scalapact.http4s21.impl.HttpInstances | ||
|
||
trait PactForgerSuite extends ScalaPactForgerDsl with HttpInstances with JsonInstances |
6 changes: 6 additions & 0 deletions
6
scalapact-scalatest-suite/src/main/scala/com/itv/scalapact/PactVerifySuite.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,6 @@ | ||
package com.itv.scalapact | ||
|
||
import com.itv.scalapact.circe13.JsonInstances | ||
import com.itv.scalapact.http4s21.impl.HttpInstances | ||
|
||
trait PactVerifySuite extends ScalaPactVerifyDsl with HttpInstances with JsonInstances |
15 changes: 15 additions & 0 deletions
15
scalapact-scalatest-suite/src/test/scala/com/itv/scalapact/PactForgerSuiteSpec.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,15 @@ | ||
package com.itv.scalapact | ||
|
||
//should compile | ||
class PactForgerSuiteSpec extends PactForgerSuite { | ||
val pact = | ||
forgePact | ||
.between("consumer") | ||
.and("provider") | ||
.addInteraction( | ||
interaction | ||
.description("") | ||
.uponReceiving(GET, "") | ||
.willRespondWith(200) | ||
).runConsumerTest(_ => ()) | ||
} |
9 changes: 9 additions & 0 deletions
9
scalapact-scalatest-suite/src/test/scala/com/itv/scalapact/PactVerifySuiteSpec.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,9 @@ | ||
package com.itv.scalapact | ||
|
||
//Should compile | ||
class PactVerifySuiteSpec extends PactVerifySuite { | ||
val verify = verifyPact | ||
.withPactSource(loadFromLocal("")) | ||
.noSetupRequired | ||
.runVerificationAgainst(80) | ||
} |
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
Oops, something went wrong.