Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3405 Replaced Mockito.mock by creating actual objects #3550

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.params.provider.Arguments.arguments;
import static org.mockito.Mockito.mock;
//import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

class VertxGeneratorIsApplicableTest {
Expand All @@ -38,8 +38,8 @@ class VertxGeneratorIsApplicableTest {

@BeforeEach
void setUp() {
project = mock(JavaProject.class, Mockito.RETURNS_DEEP_STUBS);
context = mock(GeneratorContext.class, Mockito.RETURNS_DEEP_STUBS);
project = JavaProject.builder().build();
context = GeneratorContext.builder().project(project).build();
when(context.getProject()).thenReturn(project);
}

Expand All @@ -56,8 +56,9 @@ static Stream<Arguments> data() {
@MethodSource("data")
void isApplicable(String testDescription, List<Plugin> pluginList, List<Dependency> dependencyList, boolean expectedValue) {
// Given
when(project.getPlugins()).thenReturn(pluginList);
when(project.getDependencies()).thenReturn(dependencyList);
context = context.toBuilder()
.project(project.toBuilder().plugins(pluginList).dependencies(dependencyList).build())
.build();
// When
final boolean result = new VertxGenerator(context).isApplicable(Collections.emptyList());
// Then
Expand Down