mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-07-04 09:09:18 +02:00
Limit scopes and rename bean (#1991)
This limits the scope of all cli related classes, so that they cannot be used outside of cli context and therefore cannot confuse other developers. Secondly, we rename RepositoryCommandDto to RepositoryCommandBean, because we have no data transfers here and the name might be confusing otherwise.
This commit is contained in:
@@ -28,7 +28,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Answers;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import sonia.scm.repository.Repository;
|
||||
@@ -42,7 +41,7 @@ import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class RepositoryToRepositoryCommandDtoMapperTest {
|
||||
class RepositoryToRepositoryCommandBeanMapperTest {
|
||||
|
||||
@Mock
|
||||
private RepositoryServiceFactory serviceFactory;
|
||||
@@ -61,7 +60,7 @@ class RepositoryToRepositoryCommandDtoMapperTest {
|
||||
void shouldMapAttributes() {
|
||||
Repository testRepo = RepositoryTestData.create42Puzzle();
|
||||
when(serviceFactory.create(testRepo)).thenReturn(service);
|
||||
RepositoryCommandDto dto = mapper.map(testRepo);
|
||||
RepositoryCommandBean dto = mapper.map(testRepo);
|
||||
|
||||
assertThat(dto.getNamespace()).isEqualTo(testRepo.getNamespace());
|
||||
assertThat(dto.getName()).isEqualTo(testRepo.getName());
|
||||
@@ -88,7 +87,7 @@ class RepositoryToRepositoryCommandDtoMapperTest {
|
||||
when(serviceFactory.create(testRepo)).thenReturn(service);
|
||||
when(service.getSupportedProtocols()).thenReturn(ImmutableList.of(scmProtocol).stream());
|
||||
|
||||
RepositoryCommandDto dto = mapper.map(testRepo);
|
||||
RepositoryCommandBean dto = mapper.map(testRepo);
|
||||
|
||||
assertThat(dto.getUrl()).isEqualTo("http://localhost:8081/scm");
|
||||
}
|
||||
Reference in New Issue
Block a user