mockitoScala


License

License

Categories

Categories

Scala Languages Mockito Unit Testing
GroupId

GroupId

org.markushauck
ArtifactId

ArtifactId

mockitoscala_2.12
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

mockitoScala
mockitoScala
Project URL

Project URL

https://github.com/markus1189/mockito-scala
Project Organization

Project Organization

org.markushauck
Source Code Management

Source Code Management

https://github.com/markus1189/mockito-scala

Download mockitoscala_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/org.markushauck/mockitoscala_2.12/ -->
<dependency>
    <groupId>org.markushauck</groupId>
    <artifactId>mockitoscala_2.12</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.markushauck/mockitoscala_2.12/
implementation 'org.markushauck:mockitoscala_2.12:0.3.0'
// https://jarcasting.com/artifacts/org.markushauck/mockitoscala_2.12/
implementation ("org.markushauck:mockitoscala_2.12:0.3.0")
'org.markushauck:mockitoscala_2.12:jar:0.3.0'
<dependency org="org.markushauck" name="mockitoscala_2.12" rev="0.3.0">
  <artifact name="mockitoscala_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.markushauck', module='mockitoscala_2.12', version='0.3.0')
)
libraryDependencies += "org.markushauck" % "mockitoscala_2.12" % "0.3.0"
[org.markushauck/mockitoscala_2.12 "0.3.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.2
org.mockito : mockito-core jar 2.7.21

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.0.1

Project Modules

There are no modules declared in this project.

.-=] ABANDONED [=-.

This project is abandoned and not maintained any more, you might want to have a look at https://github.com/mockito/mockito-scala

Mockito Sugar for Scala

Build Status Maven Central

Overview

Inspired by specs2, this is a Scala library that builds on mockito and provides a thin wrapper around the API to make it more pleasurable (and safer) to use in Scala.

This library does not depend on any specific testing framework! Therefore you are free to use it with specs2, ScalaTest or something else.

Why?

The Java API for Mockito is good, but once you are used to some syntactic conveniences from specs2's Mockito trait, it feels very clunky. When using other test frameworks that specs2, there was up until now nothing that provides this form of convenience, therefore this library was written.

This library provides a lightweight Scala DSL around Mockito's Java API. The goals are:

  • more convenient syntax
  • less runtime exceptions on API misuse
  • easy to fall back to Java API when necessary

How?

Add it to your sbt build:

libraryDependencies ++= Seq(
  "org.markushauck" %% "mockitoscala" % "0.3.0"
)

or import it in Ammonite:

import $ivy.`org.markushauck::mockitoscala:0.3.0`

Finally, extend from MockitoSugar trait in your test suite or import all members of the companion object.

Examples!

Please see Examples for an overview of what is currently possible.

Contributing

Contributions via GitHub pull requests are gladly accepted from their original author. Along with any pull requests, please state that the contribution is your original work and that you license the work to the project under the project's open source license. Whether or not you state this explicitly, by submitting any copyrighted material via pull request, email, or other means you agree to license the material under the project's open source license and warrant that you have the legal authority to do so.

License

This code is open source software licensed under the Apache 2.0 License.

Versions

Version
0.3.0
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2