### Question:
UIGit extends VCS implements IVCS { @Override public boolean push() { return push( "default" ); }  @Override String getType(); @Override String getDirectory(); @Override String getAuthorName( String commitId ); @Override String getCommitMessage( String commitId ); @Override String getCommitId( String revstr ); @Override String getParentCommitId( String revstr ); @Override String getBranch(); @Override List<String> getLocalBranches(); @Override List<String> getBranches(); @Override String getRemote(); @Override void addRemote( String value ); @Override void removeRemote(); @Override boolean hasRemote(); @Override boolean commit( String authorName, String message ); @Override List<ObjectRevision> getRevisions(); @Override List<UIFile> getUnstagedFiles(); @Override List<UIFile> getStagedFiles(); @Override List<UIFile> getStagedFiles( String oldCommitId, String newCommitId ); @Override boolean hasStagedFiles(); @Override void initRepo( String baseDirectory ); @Override void openRepo( String baseDirectory ); @Override void closeRepo(); @Override void add( String filepattern ); @Override void rm( String filepattern ); @Override void reset( String name ); @Override void resetPath( String path ); @Override boolean rollback( String name ); @Override boolean pull(); @Override boolean push(); @Override boolean push( String type ); @Override String diff( String oldCommitId, String newCommitId ); @Override String diff( String oldCommitId, String newCommitId, String file ); @Override InputStream open( String file, String commitId ); boolean cloneRepo( String directory, String uri ); @Override void checkout( String name ); @Override void checkoutBranch( String name ); @Override void checkoutTag( String name ); @Override void revertPath( String path ); @Override boolean createBranch( String value ); @Override boolean deleteBranch( String name, boolean force ); @Override boolean merge(); @Override String getShortenedName( String name, String type ); @Override boolean isClean(); @Override List<String> getTags(); @Override boolean createTag( String name ); @Override boolean deleteTag( String name ); @Override String getExpandedName( String name, String type ); @Override void setCredential( String username, String password );  }### Answer:
@Test public void testPush() throws Exception { Git git2 = new Git( db2 ); UIGit uiGit2 = new UIGit(); uiGit2.setGit( git2 ); URIish uri = new URIish( db2.getDirectory().toURI().toURL() ); RemoteAddCommand cmd = git.remoteAdd(); cmd.setName( Constants.DEFAULT_REMOTE_NAME ); cmd.setUri( uri ); cmd.call(); assertTrue( uiGit.hasRemote() ); RevCommit commit = git.commit().setMessage( "initial commit" ).call(); Ref tagRef = git.tag().setName( "tag" ).call(); try { db2.resolve( commit.getId().getName() + "^{commit}" ); fail( "id shouldn't exist yet" ); } catch ( MissingObjectException e ) { } boolean success = uiGit.push(); assertTrue( success ); assertEquals( commit.getId(), db2.resolve( commit.getId().getName() + "^{commit}" ) ); assertEquals( tagRef.getObjectId(), db2.resolve( tagRef.getObjectId().getName() ) ); EnterSelectionDialog esd = mock( EnterSelectionDialog.class ); doReturn( "tag" ).when( esd ).open(); doReturn( esd ).when( uiGit ).getEnterSelectionDialog( any(), anyString(), anyString() ); uiGit.push( IVCS.TYPE_TAG ); assertTrue( success ); assertTrue( uiGit2.getTags().contains( "tag" ) ); writeTrashFile( "Test2.txt", "Hello world" ); git.add().addFilepattern( "Test2.txt" ).call(); commit = git.commit().setMessage( "second commit" ).call(); doReturn( Constants.MASTER ).when( esd ).open(); uiGit.push( IVCS.TYPE_BRANCH ); assertTrue( success ); assertEquals( commit.getId(), db2.resolve( commit.getId().getName() + "^{commit}" ) ); assertEquals( "refs/remotes/origin/master", uiGit.getExpandedName( "origin/master", "branch" ) ); }