diff --git a/_posts/2000-01-01-intro.md b/_posts/2000-01-01-intro.md index 578ab15..9c3a527 100755 --- a/_posts/2000-01-01-intro.md +++ b/_posts/2000-01-01-intro.md @@ -10,11 +10,10 @@ style: center
-[![Build Status](https://travis-ci.org/mockito/mockito.svg?branch=release/2.x)](https://travis-ci.org/mockito/mockito) +[![Build Status](https://travis-ci.org/mockito/mockito.svg?branch=release/3.x)](https://travis-ci.org/mockito/mockito) [![Coverage Status](https://img.shields.io/codecov/c/github/mockito/mockito.svg)](https://codecov.io/github/mockito/mockito) [![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mockito/mockito/blob/master/LICENSE) -[![Bintray](https://api.bintray.com/packages/mockito/maven/mockito-development/images/download.svg)](https://bintray.com/mockito/maven) [![Maven Central](https://img.shields.io/maven-central/v/org.mockito/mockito-core.svg)](https://search.maven.org/search?q=g:org.mockito%20AND%20a:mockito-core&core=gav)
@@ -24,35 +23,35 @@ style: center -### Current version is 2 +### Project status -Still on Mockito 1.x? See [what's new in Mockito 2](https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2)! +Please see the [release notes page](https://github.com/mockito/mockito/releases). -See the [release notes page](https://github.com/mockito/mockito/blob/release/2.x/doc/release-notes/official.md) -and [latest documentation](https://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html) -(docs in javadoc.io are available 24h after release). +Updates are announced via our [mailing list] Google Groups. -Older 1.x releases are available in [Central Repository](https://search.maven.org/artifact/org.mockito/mockito-core/1.10.19/jar) -, [Bintray](https://bintray.com/mockito/maven/mockito/1.10.19/view) and [javadoc.io](https://www.javadoc.io/doc/org.mockito/mockito-core/1.10.19) (documentation). +Mockito downloads and instructions for setting up Maven, Gradle and other build systems are available from the +[Central Repository](https://search.maven.org/artifact/org.mockito/mockito-core/). - -(why above ad?) +The documentation for all versions is available on +[javadoc.io](https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html) +(the site is updated within 24 hours of the latest release). -### Project status updates +**Still on Mockito 1.x?** See [what's new in Mockito 2](https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2)! +Mockito 3.x requires Java 8, but otherwise doesn't introduce any breaking changes compared to the 2.x series. -Updates are announced via [Twitter](https://twitter.com/mockitojava) Twitter logo and [mailing list] Google Groups. + +(why above ad?) -After releasing Mockito 2 (see what's new) the team will continue to improve version 2.x for a short time, then focus on Mockito 3. -Please provide your feedback and suggestions for the scope of Mockito 3.x using the above two channels and GitHub issue tracker. -Mockito 3.x will target Java 8. ### Contributions welcome Fancy getting world-wide visibility and building up an eternal fame of an OSS contributor? +* Use the [latest version](https://github.com/mockito/mockito/releases)! Hack and experiment. +* Speak up at the [mailing list]. +* Report issues and suggest ideas on the [GitHub issue tracker](https://github.com/mockito/mockito/issues). * Help the [project site](https://github.com/mockito/mockito.github.io) look decent and match the quality of the library! -* [Contribute](https://github.com/mockito/mockito/blob/release/2.x/.github/CONTRIBUTING.md) a pull request! It is automatically released via state-of-art [continuous delivery automation](https://szczepiq.blogspot.com/2014_08_01_archive.html). -* Use latest version! Hack and experiment. Speak up at the [mailing list]. Report [issues and new features](https://github.com/mockito/mockito/issues). +* [Contribute](https://github.com/mockito/mockito/blob/release/3.x/.github/CONTRIBUTING.md) a pull request! It is automatically released via state-of-art [continuous delivery automation](https://szczepiq.blogspot.com/2014_08_01_archive.html). diff --git a/_posts/2000-01-02-why.md b/_posts/2000-01-02-why.md index 57249e2..1eb03d1 100755 --- a/_posts/2000-01-02-why.md +++ b/_posts/2000-01-02-why.md @@ -14,7 +14,6 @@ Read more about [features & motivations](https://github.com/mockito/mockito/wiki * Massive StackOverflow community voted Mockito the best mocking framework for java. Even though StackOverflow shuns questions that likely raise emotional debates the fact is [Mockito has the most votes](http://stackoverflow.com/questions/22697/whats-the-best-mock-framework-for-java). -You can add your vote, too! * Top 10 Java library across all libraries, not only the testing tools. In late 2013 there was an [analysis](http://blog.takipi.com/we-analyzed-30000-github-projects-here-are-the-top-100-libraries-in-java-js-and-ruby) diff --git a/_posts/2000-01-10-how.md b/_posts/2000-01-10-how.md index 4ecb37f..c1222ef 100755 --- a/_posts/2000-01-10-how.md +++ b/_posts/2000-01-10-how.md @@ -11,21 +11,17 @@ on "mockito-core" library using your favorite build system. With [Gradle](http://gradle.org) one can do: {% highlight Groovy %} -repositories { jcenter() } -dependencies { testCompile "org.mockito:mockito-core:2.+" } +repositories { mavenCentral() } +dependencies { testImplementation "org.mockito:mockito-core:5.+" } {% endhighlight %} Maven users can declare a [dependency on mockito-core](https://search.maven.org/search?q=g:org.mockito%20a:mockito-core). -Mockito is automatically published to [Bintray's jcenter](http://jcenter.bintray.com/org/mockito/mockito-core) -and synced to the Maven Central Repository. +Mockito publishes every change as a `-SNAPSHOT` version to a public [Sonatype repository](https://search.maven.org/artifact/org.mockito/mockito-core). Users doing manual dependency management can download the jars directly from -[Mockito's Bintray repository](https://bintray.com/mockito/maven/mockito-development/_latestVersion), -under the Files tab. +[Maven Central](https://repo1.maven.org/maven2/org/mockito/mockito-core/). -Legacy builds with manual dependency management can use 1.* "mockito-all" distribution. -It can be downloaded from Mockito's Bintray repository or Bintray's jcenter. -"mockito-all" distribution has been discontinued in Mockito 2.*. +Legacy builds with manual dependency management can use the [1.* "mockito-all" distribution](https://repo1.maven.org/maven2/org/mockito/mockito-all/). Said distribution has been discontinued in Mockito 2.\*. ## now you can verify interactions @@ -34,6 +30,8 @@ import static org.mockito.Mockito.*; // mock creation List mockedList = mock(List.class); +// or even simpler with Mockito 4.10.0+ +// List mockedList = mock(); // using mock object - it does not throw any "unexpected interaction" exception mockedList.add("one"); @@ -49,6 +47,8 @@ verify(mockedList).clear(); {% highlight Java %} // you can mock concrete classes, not only interfaces LinkedList mockedList = mock(LinkedList.class); +// or even simpler with Mockito 4.10.0+ +// LinkedList mockedList = mock(); // stubbing appears before the actual execution when(mockedList.get(0)).thenReturn("first"); diff --git a/_posts/2000-01-15-more.md b/_posts/2000-01-15-more.md index a2c02ee..2472bf0 100755 --- a/_posts/2000-01-15-more.md +++ b/_posts/2000-01-15-more.md @@ -6,19 +6,19 @@ fa-icon: book ## More info -[Main reference documentation](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html) features: +[Main reference documentation](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html) features: -* [`mock()`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html#mock-java.lang.Class-)/[`@Mock`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mock.html): create mock - * optionally specify how it should behave via [`Answer`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/stubbing/Answer.html)/[`MockSettings`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/MockSettings.html) - * [`when()`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html#when-T-)/[`given()`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/BDDMockito.html#given-T-) to specify how a mock should behave - * If the provided answers don't fit your needs, write one yourself extending the [`Answer`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/stubbing/Answer.html) interface -* [`spy()`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html#spy-T-)/[`@Spy`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Spy.html): +* [`mock()`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#mock-java.lang.Class-)/[`@Mock`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mock.html): create mock + * optionally specify how it should behave via [`Answer`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/stubbing/Answer.html)/[`MockSettings`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/MockSettings.html) + * [`when()`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#when-T-)/[`given()`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/BDDMockito.html#given-T-) to specify how a mock should behave + * If the provided answers don't fit your needs, write one yourself extending the [`Answer`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/stubbing/Answer.html) interface +* [`spy()`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#spy-T-)/[`@Spy`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Spy.html): partial mocking, real methods are invoked but still can be verified and stubbed -* [`@InjectMocks`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/InjectMocks.html): automatically inject mocks/spies fields annotated with `@Spy` or `@Mock` -* [`verify()`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html#verify-T-): to check methods were called with given arguments - * can use flexible argument matching, for example any expression via the [`any()`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/ArgumentMatchers.html#any--) - * or capture what arguments were called using [`@Captor`](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Captor.html) instead -* Try Behavior-Driven development syntax with [BDDMockito](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/BDDMockito.html) +* [`@InjectMocks`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/InjectMocks.html): automatically inject mocks/spies fields annotated with `@Spy` or `@Mock` +* [`verify()`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#verify-T-): to check methods were called with given arguments + * can use flexible argument matching, for example any expression via the [`any()`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/ArgumentMatchers.html#any--) + * or capture what arguments were called using [`@Captor`](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Captor.html) instead +* Try Behavior-Driven development syntax with [BDDMockito](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/BDDMockito.html) * Use Mockito on Android, thanks to the team working on [dexmaker](https://github.com/crittercism/dexmaker) ## Remember @@ -28,9 +28,9 @@ fa-icon: book * Don't mock everything * Show love with your tests! -Click [here](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html) for more documentation and examples. +Click [here](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html) for more documentation and examples. All documentation lives in javadocs so you don’t need to visit that page too often. -There is also a [RefCard](http://refcardz.dzone.com/refcardz/mockito). +There is also a [RefCard](https://dzone.com/refcardz/mockito). If you have suggestions, find documentation unclear, or find a bug, write to our [mailing list](http://groups.google.com/group/mockito). You can report feature requests and bugs in [GitHub](https://github.com/mockito/mockito/issues). diff --git a/_posts/2000-01-20-who.md b/_posts/2000-01-20-who.md index 7a6a4e7..62e5d5d 100755 --- a/_posts/2000-01-20-who.md +++ b/_posts/2000-01-20-who.md @@ -19,8 +19,8 @@ Friends who contributed to Mockito (apologize if I missed somebody): **Pascal Schumacher**, **Christian Schwartz**, **Igor Czechowski**, **Patric Fornasier**, **Jim Barritt**, **Felix Leipold**, **Liz Keogh**, **Dan North**, **Bartosz Bańkowski**, **David Wallace**. -[Travis CI](https://travis-ci.org/mockito/mockito) and [Bintray](https://bintray.com/mockito/maven/mockito) are used to facilitate continuous delivery. -Both tools are great. Thank you Travis, thank you Bintray! +[GitHub actions](https://github.com/mockito/mockito/actions) and [Shipkit](http://shipkit.org) are used to facilitate continuous delivery. +Both tools are great. Thank you GitHub, thank you Shipkit! * Thanks to **Éric Lefevre-Ardant** for his long running and continuous support on the mailing-list * Thanks to **Erik Ramfelt**, and **Steve Christou** for the Jenkins server that was used originally for CI. diff --git a/_posts/2000-01-25-links.md b/_posts/2000-01-25-links.md index a5e07c3..da1e038 100755 --- a/_posts/2000-01-25-links.md +++ b/_posts/2000-01-25-links.md @@ -21,8 +21,8 @@ fa-icon: link * [Rafael's daily java blog](http://mydailyjava.blogspot.fr/) ### Other project links -* [Latest documentation](http://javadoc.io/page/org.mockito/mockito-core/latest/org/mockito/Mockito.html) -* [Dzone Reference Card](http://refcardz.dzone.com/refcardz/mockito) +* [Latest documentation](http://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html) +* [Dzone Reference Card](https://dzone.com/refcardz/mockito) * [Continuous integration server](http://travis-ci.org/mockito/mockito) * [What we are working on](https://waffle.io/mockito/mockito) diff --git a/img/google_group_icon.png b/img/google_group_icon.png new file mode 100644 index 0000000..fdeb5fd Binary files /dev/null and b/img/google_group_icon.png differ