### Question:
JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); try { List<DiffEntry> filtered = getFilteredEntries(revisionScope); for (DiffEntry entry : filtered) { EditList editList = diffFormatter.toFileHeader(entry).toEditList(); if (!editList.isEmpty()) { computeDiffEntry(entry, editList, revisionScope, scope); } } } catch (IOException e) { throw new SourceControlException(ErrorMessages.SCAN_REVISIONS_EXCEPTION, e); } return scope; } JGitChangeScopeResolver(Repository repository, SourceControlFilter... filters); @Override ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope);  }### Answer:
@Test public void testComputeChangeScopeOfLocalWithSingleChange() throws SourceControlException { Status status = mock(Status.class); when(status.hasUncommittedChanges()).thenReturn(true); when(status.getModified()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/ChangeScopeResolver.java")); mockStatic(PorcelainApi.class); when(PorcelainApi.call(any(), any())).thenReturn(status); RevisionScope<ObjectId> scope = revisionResolver.resolve(DiffConstants.LATEST_COMMIT, DiffConstants.LOCAL_CHANGES_NOT_COMMITTED); ChangeScope<Change> changeScope = jGitChangeScopeResolver.getChangeScope(scope); assertNotNull(changeScope); }
@Test public void testComputeChangeScope() throws SourceControlException { RevisionScope<ObjectId> scope = revisionResolver.resolve("fc776fe5e50", "e6f7c3d2954d6"); ChangeScope<Change> changeScope = jGitChangeScopeResolver.getChangeScope(scope); assertNotNull(changeScope); assertTrue(changeScope.getAllAffectedClasses().size() > 0); }
@Test public void testComputeChangeScopeOfLocal() throws SourceControlException { Status status = mock(Status.class); when(status.hasUncommittedChanges()).thenReturn(true); when(status.getModified()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/ChangeScopeResolver.java")); when(status.getChanged()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/RevisionResolver.java")); when(status.getAdded()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/BlameResolver.java")); mockStatic(PorcelainApi.class); when(PorcelainApi.call(any(), any())).thenReturn(status); RevisionScope<ObjectId> scope = revisionResolver.resolve(DiffConstants.LATEST_COMMIT, DiffConstants.LOCAL_CHANGES_NOT_COMMITTED); ChangeScope<Change> changeScope = jGitChangeScopeResolver.getChangeScope(scope); assertNotNull(changeScope); }