Loading ...
Sorry, an error occurred while loading the content.

Re: [junit] Junit method check

Expand Messages
  • David Saff
    santhoshjoy, JUnit does not have a built-in mocking framework. You can use Mockito with JUnit, so you don t need to give up your Mockito code. David Saff ...
    Message 1 of 2 , Apr 6 12:43 PM
    View Source
    • 0 Attachment
      santhoshjoy,

      JUnit does not have a built-in mocking framework. You can use Mockito with
      JUnit, so you don't need to give up your Mockito code.

      David Saff

      On Wed, Apr 4, 2012 at 8:58 PM, KandiSweetie7330 <santhoshjoy@...>wrote:

      > I have a Mockito code,
      >
      >
      > String[] activeGroupName = {"activeJob1", "activeJob2"};
      >
      > Mockito.when(f_active.retrieveJobNames(GROUP_NAME)).thenReturn(activeGroupName);
      > String[] inactiveGroupName = {"inactiveJob1",
      > "inactiveJob2"};
      >
      > Mockito.when(f_inactive.retrieveJobNames(GROUP_NAME)).thenReturn(inactiveGroupName);
      >
      >
      > Same I have to write in Junit. Here GROUP_NAME is a string value. If the
      > when condition gets true then i have to return the String[]. Please suggest
      > me how to write the same code in Junit.
      >
      >
      >
      > ------------------------------------
      >
      > Yahoo! Groups Links
      >
      >
      >
      >


      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.