[ https://issues.apache.org/jira/browse/GEODE-4631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357227#comment-16357227 ]
ASF subversion and git services commented on GEODE-4631: -------------------------------------------------------- Commit cd92f9a3d378f30eb7e93cbaa05be139bbbcefc6 in geode's branch refs/heads/develop from Xiaojian Zhou [ https://gitbox.apache.org/repos/asf?p=geode.git;h=cd92f9a ] GEODE-4631: need a public class to mock (#1413) > 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 > Assignee: xiaojian zhou > Priority: Major > Labels: pull-request-available > Time Spent: 20m > Remaining Estimate: 0h > > > 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)