View Javadoc
1   /*
2    * Copyright (C) 2015, Kaloyan Raev <kaloyan.r@zend.com> and others
3    *
4    * This program and the accompanying materials are made available under the
5    * terms of the Eclipse Distribution License v. 1.0 which is available at
6    * https://www.eclipse.org/org/documents/edl-v10.php.
7    *
8    * SPDX-License-Identifier: BSD-3-Clause
9    */
10  package org.eclipse.jgit.api;
11  
12  import static org.junit.Assert.assertEquals;
13  
14  import java.util.List;
15  
16  import org.eclipse.jgit.transport.RemoteConfig;
17  import org.junit.Test;
18  
19  public class RemoteListCommandTest extends AbstractRemoteCommandTest {
20  
21  	@Test
22  	public void testList() throws Exception {
23  		// setup an initial remote
24  		RemoteConfig remoteConfig = setupRemote();
25  
26  		// execute the command to list the remotes
27  		List<RemoteConfig> remotes = Git.wrap(db).remoteList().call();
28  
29  		// assert that there is only one remote
30  		assertEquals(1, remotes.size());
31  		// assert that the available remote is the initial remote
32  		assertRemoteConfigEquals(remoteConfig, remotes.get(0));
33  	}
34  
35  }