Java Code Examples for org.mockito.BDDMockito#spy()

The following examples show how to use org.mockito.BDDMockito#spy() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void should_not_commit_if_the_same_version_is_already_there() {
	ProjectVersion releaseTrainVersion = new ProjectVersion("spring-cloud-release",
			"Dalston.SR3");
	ReleaserProperties properties = new ReleaserProperties();
	properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
	ProjectGitHandler handler = BDDMockito.spy(new ProjectGitHandler(properties));

	new SpringCloudCustomProjectDocumentationUpdater(handler, properties)
			.updateDocsRepoForReleaseTrain(this.clonedDocProject, releaseTrainVersion,
					projects(), "vDalston.SR3");

	BDDMockito.then(handler).should(BDDMockito.never())
			.commit(BDDMockito.any(File.class), BDDMockito.anyString());
}
 
Example 2
@Test
public void should_do_nothing_when_release_train_docs_update_happen_for_a_project_that_does_not_start_with_spring_cloud() {
	ProjectVersion springBootVersion = new ProjectVersion("spring-boot", "2.2.5");
	ReleaserProperties properties = new ReleaserProperties();
	properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
	ProjectGitHandler handler = BDDMockito.spy(new ProjectGitHandler(properties));

	new SpringCloudCustomProjectDocumentationUpdater(handler, properties)
			.updateDocsRepoForReleaseTrain(this.clonedDocProject, springBootVersion,
					bootProject(), "vDalston.SR3");

	BDDMockito.then(handler).should(BDDMockito.never())
			.commit(BDDMockito.any(File.class), BDDMockito.anyString());
}
 
Example 3
@Test
public void should_do_nothing_when_single_project_docs_update_happen_for_a_project_that_does_not_start_with_spring_cloud() {
	ProjectVersion springBootVersion = new ProjectVersion("spring-boot", "2.2.5");
	ReleaserProperties properties = new ReleaserProperties();
	properties.getGit().setDocumentationUrl(this.clonedDocProject.toURI().toString());
	ProjectGitHandler handler = BDDMockito.spy(new ProjectGitHandler(properties));

	new SpringCloudCustomProjectDocumentationUpdater(handler, properties)
			.updateDocsRepoForSingleProject(this.clonedDocProject, springBootVersion,
					bootProject());

	BDDMockito.then(handler).should(BDDMockito.never())
			.commit(BDDMockito.any(File.class), BDDMockito.anyString());
}
 
Example 4
@Bean
TestDocumentationUpdater testDocumentationUpdater(
		ProjectGitHandler projectGitHandler,
		ReleaserProperties releaserProperties,
		TemplateGenerator templateGenerator, @Autowired(
				required = false) List<CustomProjectDocumentationUpdater> updaters) {
	return BDDMockito.spy(new TestDocumentationUpdater(projectGitHandler,
			releaserProperties, templateGenerator, updaters));
}
 
Example 5
@Bean
@ConditionalOnProperty(value = "test.mockBuild", havingValue = "true")
BuildProjectReleaseTask mockedBuildProjectReleaseTask(Releaser releaser) {
	return BDDMockito.spy(new BuildProjectReleaseTask(releaser));
}
 
Example 6
@Bean
SaganUpdater testSaganUpdater(SaganClient saganClient,
		ReleaserProperties properties) {
	return BDDMockito.spy(new SaganUpdater(saganClient, properties));
}
 
Example 7
@Bean
FirstTask firstTask() {
	return BDDMockito.spy(new FirstTask());
}
 
Example 8
@Bean
SecondTask secondTask() {
	return BDDMockito.spy(new SecondTask());
}
 
Example 9
@Bean
PostReleaseTask firstPostReleaseTask() {
	return BDDMockito.spy(new PostReleaseTask());
}