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

The following examples show how to use org.mockito.BDDMockito#spy() . 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
Source File: SpringCloudCustomProjectDocumentationUpdaterTests.java    From spring-cloud-release-tools with Apache License 2.0 5 votes vote down vote up
@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
Source File: SpringCloudCustomProjectDocumentationUpdaterTests.java    From spring-cloud-release-tools with Apache License 2.0 5 votes vote down vote up
@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
Source File: SpringCloudCustomProjectDocumentationUpdaterTests.java    From spring-cloud-release-tools with Apache License 2.0 5 votes vote down vote up
@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
Source File: SpringMetaReleaseAcceptanceTests.java    From spring-cloud-release-tools with Apache License 2.0 5 votes vote down vote up
@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
Source File: SpringMetaReleaseAcceptanceTests.java    From spring-cloud-release-tools with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnProperty(value = "test.mockBuild", havingValue = "true")
BuildProjectReleaseTask mockedBuildProjectReleaseTask(Releaser releaser) {
	return BDDMockito.spy(new BuildProjectReleaseTask(releaser));
}
 
Example 6
Source File: SpringMetaReleaseAcceptanceTests.java    From spring-cloud-release-tools with Apache License 2.0 4 votes vote down vote up
@Bean
SaganUpdater testSaganUpdater(SaganClient saganClient,
		ReleaserProperties properties) {
	return BDDMockito.spy(new SaganUpdater(saganClient, properties));
}
 
Example 7
Source File: SpringMetaReleaseAcceptanceTests.java    From spring-cloud-release-tools with Apache License 2.0 4 votes vote down vote up
@Bean
FirstTask firstTask() {
	return BDDMockito.spy(new FirstTask());
}
 
Example 8
Source File: SpringMetaReleaseAcceptanceTests.java    From spring-cloud-release-tools with Apache License 2.0 4 votes vote down vote up
@Bean
SecondTask secondTask() {
	return BDDMockito.spy(new SecondTask());
}
 
Example 9
Source File: SpringMetaReleaseAcceptanceTests.java    From spring-cloud-release-tools with Apache License 2.0 4 votes vote down vote up
@Bean
PostReleaseTask firstPostReleaseTask() {
	return BDDMockito.spy(new PostReleaseTask());
}