@Test public void testZipInputFileTester_NonGpx() throws Exception { ZipEntry zipEntryBad = PowerMock.createMock(ZipEntry.class); GpxFilenameFilter gpxFilenameFilter = PowerMock.createMock(GpxFilenameFilter.class); expect(zipEntryBad.isDirectory()).andReturn(false); expect(zipEntryBad.getName()).andReturn("foo.txt"); expect(gpxFilenameFilter.accept("foo.txt")).andReturn(false); PowerMock.replayAll(); assertFalse(new ZipInputFileTester(gpxFilenameFilter).isValid(zipEntryBad)); PowerMock.verifyAll(); }
public boolean isValid(ZipEntry zipEntry) { return (!zipEntry.isDirectory() && mGpxFilenameFilter.accept(zipEntry.getName())); }