@Test
public void resolveGitRepositoryNotClonedBefore() {
ExampleRepository playgroundRepository = new ExampleRepository("file:///home/user/folder/.kie-wb-playground");
service.setPlaygroundRepository(playgroundRepository);
ConfigGroup configGroup = new ConfigGroup();
when(configurationFactory.newConfigGroup(any(ConfigType.class),
anyString(),
anyString(),
anyString())).thenReturn(configGroup);
doCallRealMethod().when(configurationFactory).newConfigItem(anyString(),
anyBoolean());
doCallRealMethod().when(configurationFactory).newConfigItem(anyString(),
anyString());
doCallRealMethod().when(configurationFactory).newConfigItem(anyString(),
any(Object.class));
Repository repository = mock(Repository.class);
when(repositoryFactory.newRepository(configGroup)).thenReturn(repository);
Repository result = service.resolveGitRepository(playgroundRepository);
assertEquals(repository,
result);
assertEquals(false,
configGroup.getConfigItem(EnvironmentParameters.MIRROR).getValue());
verify(repositoryFactory,
times(1)).newRepository(configGroup);
}