use of sonia.scm.ContextEntry in project scm-review-plugin by scm-manager.
the class RepositoryResolverTest method testResolveRepositoryNotFound.
@Test
public void testResolveRepositoryNotFound() {
NotFoundException exception = assertThrows(NotFoundException.class, () -> resolver.resolve(namespaceAndName));
ContextEntry contextEntry = exception.getContext().get(0);
assertThat(contextEntry.getType()).isEqualTo("Repository");
assertThat(contextEntry.getId()).isEqualTo("hitchhiker/heartOfGold");
}
use of sonia.scm.ContextEntry in project scm-review-plugin by scm-manager.
the class RepositoryResolverTest method testResolveForUnsupportedType.
@Test
public void testResolveForUnsupportedType() {
Repository repository = RepositoryTestData.createHeartOfGold("svn");
repository.setId("42");
when(repositoryManager.get(namespaceAndName)).thenReturn(repository);
when(repositoryServiceFactory.create(repository)).thenReturn(repositoryService);
when(repositoryService.isSupported(Command.MERGE)).thenReturn(Boolean.FALSE);
PullRequestNotSupportedException exception = assertThrows(PullRequestNotSupportedException.class, () -> resolver.resolve(namespaceAndName));
ContextEntry contextEntry = exception.getContext().get(0);
assertThat(contextEntry.getType()).isEqualTo("Repository");
assertThat(contextEntry.getId()).isEqualTo("hitchhiker/HeartOfGold");
}
Aggregations