use of com.google.startupos.tools.reviewer.local_server.service.CodeReviewService in project startup-os by google.
the class CodeReviewServiceTextDiffTest method setup.
@Before
public void setup() throws IOException {
Flags.parse(new String[0], AuthService.class.getPackage(), CodeReviewService.class.getPackage());
String testFolder = Files.createTempDirectory("temp").toAbsolutePath().toString();
final String initialRepoFolder = joinToAbsolutePath(testFolder, "initial_repo");
aaBaseFolder = joinToAbsolutePath(testFolder, "base_folder");
component = DaggerCodeReviewServiceTextDiffTest_TestComponent.builder().aaModule(new AaModule() {
@Provides
@Singleton
@Override
@Named("Base path")
public String provideBasePath(FileUtils fileUtils) {
return aaBaseFolder;
}
}).build();
gitRepoFactory = component.getGitRepoFactory();
fileUtils = component.getFileUtils();
codeReviewService = new CodeReviewService(component.getAuthService(), fileUtils, aaBaseFolder, gitRepoFactory, component.getTextDifferencer());
createInitialRepo(initialRepoFolder);
initAaBase(initialRepoFolder, aaBaseFolder);
createAaWorkspace(TEST_WORKSPACE);
createBlockingStub();
writeFile(TEST_FILE_CONTENTS);
testFileCommitId = repo.commit(repo.getUncommittedFiles(), COMMIT_MESSAGE).getId();
}
use of com.google.startupos.tools.reviewer.local_server.service.CodeReviewService in project startup-os by google.
the class CodeReviewServiceGetDiffFilesTest method setup.
@Before
public void setup() throws IOException {
Flags.parse(new String[0], AuthService.class.getPackage(), CodeReviewService.class.getPackage());
component = DaggerCodeReviewServiceGetDiffFilesTest_TestComponent.builder().aaModule(new AaModule() {
@Provides
@Singleton
@Override
@Named("Base path")
public String provideBasePath(FileUtils fileUtils) {
return aaBaseFolder;
}
}).build();
gitRepoFactory = component.getGitRepoFactory();
fileUtils = component.getFileUtils();
String testFolder = Files.createTempDirectory("temp").toAbsolutePath().toString();
String initialRepoFolder = fileUtils.joinToAbsolutePath(testFolder, "initial_repo");
aaBaseFolder = fileUtils.joinToAbsolutePath(testFolder, "base_folder");
codeReviewService = new CodeReviewService(component.getAuthService(), fileUtils, aaBaseFolder, gitRepoFactory, component.getTextDifferencer());
createInitialRepo(initialRepoFolder);
initAaBase(initialRepoFolder, aaBaseFolder);
createAaWorkspace(TEST_WORKSPACE);
createBlockingStub();
writeFile(TEST_FILE_CONTENTS);
testFileCommitId = repo.commit(repo.getUncommittedFiles(), COMMIT_MESSAGE).getId();
mockFirestoreClientMethods();
}
Aggregations