Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-19889

Build became unstable: LazyCredentialsPrompterTest complains about wrong Matcher usage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 4.3.0.Beta1
    • 4.3.0.Beta1
    • openshift
    • None

      I was not cautious enough when merging, the maven build currently fails with the following:

      Tests in error: 
        LazyCredentialsPrompterTest.testPromptAndAuthenticateWhenInitializedWithAPrompter:65 » InvalidUseOfMatchers
        LazyCredentialsPrompterTest.testPromptAndAuthenticateReturnsFalseWhenItCantGetAPrompter:84 » InvalidUseOfMatchers
        LazyCredentialsPrompterTest.testPromptAndAuthenticateDeferredLoadsAndPromptsWhenInitializedWithNull:75 » InvalidUseOfMatchers
      
      
      testPromptAndAuthenticateWhenInitializedWithAPrompter(org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest)  Time elapsed: 0.004 sec  <<< ERROR!
      org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
      Invalid use of argument matchers!
      2 matchers expected, 1 recorded:
      -> at org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest.testPromptAndAuthenticateWhenInitializedWithAPrompter(LazyCredentialsPrompterTest.java:65)
      
      This exception may occur if matchers are combined with raw values:
          //incorrect:
          someMethod(anyObject(), "raw String");
      When using matchers, all arguments have to be provided by matchers.
      For example:
          //correct:
          someMethod(anyObject(), eq("String by matcher"));
      
      For more info see javadoc for Matchers class.
      
      	at org.mockito.exceptions.Reporter.invalidUseOfMatchers(Reporter.java:241)
      	at org.mockito.internal.invocation.MatchersBinder.validateMatchers(MatchersBinder.java:35)
      	at org.mockito.internal.invocation.MatchersBinder.bindMatchers(MatchersBinder.java:24)
      	at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:58)
      	at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
      	at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)
      	at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:51)
      	at org.jboss.tools.openshift.common.core.ICredentialsPrompter$$EnhancerByMockitoWithCGLIB$$dadcfe44.promptAndAuthenticate(<generated>)
      	at org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest.testPromptAndAuthenticateWhenInitializedWithAPrompter(LazyCredentialsPrompterTest.java:65)
      
      testPromptAndAuthenticateReturnsFalseWhenItCantGetAPrompter(org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest)  Time elapsed: 0.001 sec  <<< ERROR!
      org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
      Invalid use of argument matchers!
      2 matchers expected, 1 recorded:
      -> at org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest.testPromptAndAuthenticateReturnsFalseWhenItCantGetAPrompter(LazyCredentialsPrompterTest.java:84)
      
      This exception may occur if matchers are combined with raw values:
          //incorrect:
          someMethod(anyObject(), "raw String");
      When using matchers, all arguments have to be provided by matchers.
      For example:
          //correct:
          someMethod(anyObject(), eq("String by matcher"));
      
      For more info see javadoc for Matchers class.
      
      	at org.mockito.exceptions.Reporter.invalidUseOfMatchers(Reporter.java:241)
      	at org.mockito.internal.invocation.MatchersBinder.validateMatchers(MatchersBinder.java:35)
      	at org.mockito.internal.invocation.MatchersBinder.bindMatchers(MatchersBinder.java:24)
      	at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:58)
      	at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
      	at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)
      	at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:51)
      	at org.jboss.tools.openshift.common.core.ICredentialsPrompter$$EnhancerByMockitoWithCGLIB$$dadcfe44.promptAndAuthenticate(<generated>)
      	at org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest.testPromptAndAuthenticateReturnsFalseWhenItCantGetAPrompter(LazyCredentialsPrompterTest.java:84)
      
      testPromptAndAuthenticateDeferredLoadsAndPromptsWhenInitializedWithNull(org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest)  Time elapsed: 0.001 sec  <<< ERROR!
      org.mockito.exceptions.misusing.InvalidUseOfMatchersException: 
      Invalid use of argument matchers!
      2 matchers expected, 1 recorded:
      -> at org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest.testPromptAndAuthenticateDeferredLoadsAndPromptsWhenInitializedWithNull(LazyCredentialsPrompterTest.java:75)
      
      This exception may occur if matchers are combined with raw values:
          //incorrect:
          someMethod(anyObject(), "raw String");
      When using matchers, all arguments have to be provided by matchers.
      For example:
          //correct:
          someMethod(anyObject(), eq("String by matcher"));
      
      For more info see javadoc for Matchers class.
      
      	at org.mockito.exceptions.Reporter.invalidUseOfMatchers(Reporter.java:241)
      	at org.mockito.internal.invocation.MatchersBinder.validateMatchers(MatchersBinder.java:35)
      	at org.mockito.internal.invocation.MatchersBinder.bindMatchers(MatchersBinder.java:24)
      	at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:58)
      	at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
      	at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:38)
      	at org.mockito.internal.creation.MethodInterceptorFilter.intercept(MethodInterceptorFilter.java:51)
      	at org.jboss.tools.openshift.common.core.ICredentialsPrompter$$EnhancerByMockitoWithCGLIB$$dadcfe44.promptAndAuthenticate(<generated>)
      	at org.jboss.tools.openshift.express.test.core.LazyCredentialsPrompterTest.testPromptAndAuthenticateDeferredLoadsAndPromptsWhenInitializedWithNull(LazyCredentialsPrompterTest.java:75)
      

            jcantril@redhat.com Jeffrey Cantrill
            adietish@redhat.com André Dietisheim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: