MapFileManagerImpl implements MapFileManager { @Override public InputStream getMapFile(String appIdentifier) throws MapFileNotExistsException { InputStream fileMap=mapFileRepository.getMapFileByAppId(appIdentifier); return fileMap; }  @Override InputStream getMapFile(String appIdentifier);  }
@Test public void getFileMap() throws MapFileNotExistsException{ String appIdentifier = "1"; Mockito.when(mapFileRepository.getMapFileByAppId(appIdentifier)).thenReturn(inputStream); InputStream response=mapFileManagerImpl.getMapFile(appIdentifier); Mockito.verify(mapFileRepository).getMapFileByAppId(appIdentifier); Assert.assertEquals("Map must be the same",inputStream,response); }