aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteListCommandTest.java
blob: 935909ea970cc7beea7589258b146122a23d01e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright (C) 2015, Kaloyan Raev <kaloyan.r@zend.com> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package org.eclipse.jgit.api;

import static org.junit.Assert.assertEquals;

import java.util.List;

import org.eclipse.jgit.transport.RemoteConfig;
import org.junit.Test;

public class RemoteListCommandTest extends AbstractRemoteCommandTest {

	@Test
	public void testList() throws Exception {
		// setup an initial remote
		RemoteConfig remoteConfig = setupRemote();

		// execute the command to list the remotes
		List<RemoteConfig> remotes = Git.wrap(db).remoteList().call();

		// assert that there is only one remote
		assertEquals(1, remotes.size());
		// assert that the available remote is the initial remote
		assertRemoteConfigEquals(remoteConfig, remotes.get(0));
	}

}