You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/02/08 02:22:00 UTC
[jira] [Commented] (GEODE-4631) Travis builds failing due to issue
in TypeUtilsJUnitTest
[ https://issues.apache.org/jira/browse/GEODE-4631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356385#comment-16356385 ]
ASF subversion and git services commented on GEODE-4631:
--------------------------------------------------------
Commit c07745710a78154471c649a414f731a18dcbd71a in geode's branch refs/heads/feature/GEODE-4631 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=c077457 ]
GEODE-4631: need a public class to mock
> Travis builds failing due to issue in TypeUtilsJUnitTest
> --------------------------------------------------------
>
> Key: GEODE-4631
> URL: https://issues.apache.org/jira/browse/GEODE-4631
> Project: Geode
> Issue Type: Bug
> Components: querying
> Reporter: Nick Reich
> Priority: Major
>
>
> Seeing the follow failure in travis builds from github:
> {noformat}
> org.apache.geode.cache.query.internal.types.TypeUtilsJUnitTest > getRegionEntryTypeShouldReturnTheProperTypeImplementation FAILED
> org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
> Misplaced or misused argument matcher detected here:
> -> at org.apache.geode.cache.query.internal.types.TypeUtilsJUnitTest.lambda$booleanCompareShouldThrowExceptionIfValuesAreNotInstancesOfBoolean$7(TypeUtilsJUnitTest.java:441)
> -> at org.apache.geode.cache.query.internal.types.TypeUtilsJUnitTest.lambda$booleanCompareShouldThrowExceptionIfValuesAreNotInstancesOfBoolean$8(TypeUtilsJUnitTest.java:444)
> -> at org.apache.geode.cache.query.internal.types.TypeUtilsJUnitTest.lambda$booleanCompareShouldThrowExceptionIfValuesAreNotInstancesOfBoolean$9(TypeUtilsJUnitTest.java:447)
> You cannot use argument matchers outside of verification or stubbing.
> Examples of correct usage of argument matchers:
> when(mock.get(anyInt())).thenReturn(null);
> doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
> verify(mock).someMethod(contains("foo"))
> This message may appear after an NullPointerException if the last matcher is returning an object
> like any() but the stubbed method signature expect a primitive argument, in this case,
> use primitive alternatives.
> when(mock.get(any())); // bad use, will raise NPE
> when(mock.get(anyInt())); // correct usage use
> Also, this error might show up because you use argument matchers with methods that cannot be mocked.
> Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
> Mocking methods declared on non-public parent classes is not supported.
> at org.apache.geode.cache.query.internal.types.TypeUtilsJUnitTest.getRegionEntryTypeShouldReturnTheProperTypeImplementation(TypeUtilsJUnitTest.java:429){noformat}
> The issue does not reproduce locally however.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)