title: Null value when trying to mock a byte[] value in with junit5 and mockito
body: <p>I'm trying to mock a <code>byte</code> but in the method this value is <code>null</code>. I'm using the <code>eq()</code> method to send the <code>byte[]</code> that I need to test this method.</p>
  
  <p>This is the signature of my method:</p>
  
  <pre><code>      @Override
        public void addFile(String directory, String fileName, byte[] content) throws IOException {
          try (SftpSession session = sessionFactory.getSession()) {
            makeSureDirectoryIsAvailable(session, directory);
  
            InputStream fileByteStream = new ByteArrayInputStream(content);
            session.write(fileByteStream, directory + "/" + fileName);
          }
        }
  </code></pre>
  
  <p>When I take a look to the content variable it is <code>null</code> and the strings are empty, I am not pretty sure how can I mock this value, the next is the code of my test, I'm using JUnit 5.</p>
  
  <pre><code>package service;
  
  import org.junit.jupiter.api.BeforeEach;
  import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.extension.ExtendWith;
  import org.mockito.Mock;
  import org.mockito.MockitoAnnotations;
  import org.mockito.junit.MockitoJUnitRunner;
  import org.mockito.junit.jupiter.MockitoExtension;
  import org.mockito.junit.jupiter.MockitoSettings;
  import org.mockito.quality.Strictness;
  import org.springframework.integration.sftp.session.DefaultSftpSessionFactory;
  import org.springframework.integration.sftp.session.SftpSession;
  
  import static org.mockito.ArgumentMatchers.*;
  import static org.mockito.BDDMockito.given;
  
  @ExtendWith(MockitoExtension.class)
  @MockitoSettings(strictness = Strictness.LENIENT)
  class SFTPServiceImplTest {
  
      @Mock
      SftpSession sftpSession;
      @Mock
      DefaultSftpSessionFactory sessionFactory;
  
      private SFTPServiceImpl sftpServiceImpl;
  
      @BeforeEach
      public void init() {
          MockitoAnnotations.initMocks(this);
          sftpServiceImpl = new SFTPServiceImpl(sessionFactory);
      }
  
      @Test
      void addFile() throws Exception {
          byte[] bytes = {69, 121, 101, 45, 62, 118, 101, 114, (byte) 196, (byte) 195, 61, 101, 98};
  
          given(sessionFactory.getSession()).willReturn(sftpSession);
          given(sftpSession.exists(anyString())).willReturn(false);
  
          sftpServiceImpl.addFile(anyString(), anyString(),eq(bytes));
      }
  
      @Test
      void getFileContent() {
      }
  
      @Test
      void deleteFile() {
      }
  
      @Test
      void moveFile() {
      }
  
      @Test
      void listFiles() {
      }
  }
  </code></pre>