Git Product home page Git Product logo

dirty-mockito's People

Contributors

aisrael avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dirty-mockito's Issues

Supporting existing SpringContext

Version: 0.2

I've been looking around for something that integrates Spring and Mockito,
and this is an interesting approach.

I think it could be evolved to be more generally useful.

For example, I want to use a mock bean to test that my ReSTful web app is
calling the correct methods, and responding correctly to exceptions.

In this case, the mock needs to be available to the WebApplication context,
and it Mockito.reset(T ... mocks) needs to be called between each test.


Original issue reported on code.google.com by [email protected] on 8 Sep 2009 at 2:19

Feature: Recursive mock handling

Yesterday I ran into a problem:

class A {
  @EJB B b;
}

class B {
  @Resource C c;
}

Testing "A" I can just mock for "B" (using your example code) but because "B" 
needs "C" I can't run the test without NullPointerException.

So I wish it could be possible to handle this kind behaviour.

Original issue reported on code.google.com by DannyLade on 26 Jan 2012 at 8:03

Feature: add annotation @Spy

Sometimes it is possible to use a Mockito.spy() instead of Mockito.mock() - if 
you need mostly the orginal methods but mock just a few of them. In this case 
it would be nice to have an annotation like this:

public class ATest extends ActiveTest<B> {

  @Mock
  private EntityManager em;

  @Spy
  private SomeService service = new SomeService();
...
  // mock just one method
  when(service.doIt()).thenReturn(result);

  // it calls doIt()
  service.doItNow();

  verify(service).doIt();
...

It should be part of the automatic injection too (like @Mock).

Original issue reported on code.google.com by DannyLade on 26 Jan 2012 at 8:13

Publish to Maven Central [help offered]

Reason: It'd be nice to use dirty-mockito a bit more widely, but adding a 
repository that can disappear is often not allowed on significant open source 
and commercial projects.

I recently jumped through this hoop, and it wasn't as challenging as I'd 
feared.  Sonatype were very quick in setting up the staging repository and it 
just took me a few iterations to pass the quality checks (i.e. that I was 
providing sources, and javadoc).

If you'd like some help, then I'd be happy to oblige.


Original issue reported on code.google.com by [email protected] on 21 Jun 2011 at 10:55

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.