@Test public void testNotExisting() throws IOException, InterruptedException { RestApi.Folder r = new RestApi.Folder(); r.path = new File( new MockContext(InstrumentationRegistry.getTargetContext()).getFilesDir(), "not-existing") .getPath(); r.id = "testNotExisting"; try { new FolderObserver(this, r); Assert.fail("Expected FolderNotExistingException"); } catch (FolderObserver.FolderNotExistingException e) { Assert.assertTrue(e.getMessage().contains(r.path)); } }
private RestApi.Folder createFolder(String id) { RestApi.Folder r = new RestApi.Folder(); r.path = mTestFolder.getPath(); r.id = id; return r; }