Form { public void forceSave() { forceSave(null); } protected  Form(Builder<S, D> builder); void display(Bundle bundle); void display(); boolean save(); void forceSave(); boolean save(Bundle bundle); void forceSave(Bundle bundle);  }
@Test public void testForceSave() throws Exception { AuthModelSource source = new AuthModelSource(null); AuthModelDrain drain = new AuthModelDrain(null); Form form = new Form.Builder<>(source, drain, mapper).build(); form.forceSave(); assertNotNull(drain.getDrain()); source.getSource().password = PASSWORD; source.getSource().email = "INVALID"; form.forceSave(); assertEquals("INVALID", drain.getDrain().email); assertEquals(PASSWORD, drain.getDrain().password); }
@Test public void testForceSaveWithBundle() throws Exception { AuthModelDrain drain = new AuthModelDrain(null); Form form = new Form.Builder<>(new AuthModelSource(null), drain, mapper) .withDrainExtrasMapper(bundleAuthModelDrainMapper).build(); form.forceSave(bundle); assertNotNull(drain.getDrain()); assertNull(drain.getDrain().email); assertNull(drain.getDrain().password); assertEquals(EXTRA, drain.getDrain().extra); }