Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mockito-groovy-support 1.0.1 doesn't work #10

Open
georgema1982 opened this issue Sep 9, 2013 · 4 comments
Open

mockito-groovy-support 1.0.1 doesn't work #10

georgema1982 opened this issue Sep 9, 2013 · 4 comments

Comments

@georgema1982
Copy link

I'm using groovy 2.1.3, mockito1.9.5 and mockito-groovy-support 1.0.1 (as it's the only version in maven). But I'm still getting the NullPointerException.

@lgdean
Copy link
Contributor

lgdean commented Sep 20, 2013

1.2 is up on the maven central repo now. Does it work for you?
If not, let us know a few more details of any problem you run into with 1.2. Thanks!

@ekorshunova
Copy link

For me it also does not work. I am using mockito 1.9.0, groovy 2.3.6, mockito-groovy-support 1.3.
I still get NullPointerException. My groovy class:
class NewPaymentTypeBuilder {

def String getTest() {
    return "String"
}

}

My test class:
class SomeTest {

@Before
void setUp() throws Exception {
    MockitoAnnotations.initMocks(this)

    NewPaymentTypeBuilder test = mock(NewPaymentTypeBuilder.class)
    when(test.getTest()).thenReturn("fgdf")
}

@Test
public void testSome() {
    println "yes"
}

}

@ekorshunova
Copy link

I upgraded the version for mockito and it works. So, sorry for the comment above.

@lgdean
Copy link
Contributor

lgdean commented Sep 24, 2014

No need to apologize! I'd much rather see info that turns out not to help, than have someone not post info that might have helped.
I'm glad it ended up working for you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants