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

Upgrade to Mockito 4.11.0 with some small required code changes #174

Merged
merged 1 commit into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.8.5</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import java.net.URL;
import java.util.*;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.same;
import static org.mockito.Mockito.*;

public class JavaProjectBuilderTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Collections;
import java.util.List;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

Expand Down
8 changes: 4 additions & 4 deletions src/test/java/com/thoughtworks/qdox/parser/ParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.stubbing.answers.ReturnsElementsOf;

import java.util.Collection;
import java.util.LinkedList;

import static org.mockito.Mockito.*;
import static org.mockito.AdditionalAnswers.returnsElementsOf;

public class ParserTest {

Expand Down Expand Up @@ -3137,9 +3137,9 @@ private void setupLex( int token ) throws Exception
setupLex( token, null );
if ( token == 0 )
{
when( lexer.lex() ).thenAnswer( new ReturnsElementsOf( lexValues ) );
when( lexer.text() ).thenAnswer( new ReturnsElementsOf( textValues ) );
when( lexer.getCodeBody() ).thenAnswer( new ReturnsElementsOf( codeBodyValues ) );
when( lexer.lex() ).thenAnswer( returnsElementsOf( lexValues ) );
when( lexer.text() ).thenAnswer( returnsElementsOf( textValues ) );
when( lexer.getCodeBody() ).thenAnswer( returnsElementsOf( codeBodyValues ) );
when( lexer.getLine() ).thenReturn( -1 );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.stubbing.answers.ReturnsElementsOf;

import java.io.IOException;
import java.util.Collection;
import java.util.LinkedList;

import static org.mockito.Mockito.*;
import static org.mockito.AdditionalAnswers.returnsElementsOf;

public class DefaultJavaCommentParserTest
{
Expand Down Expand Up @@ -208,8 +208,8 @@ private void setupLex(int token) throws IOException {
setupLex(token, null);
if( token == 0)
{
when( lexer.lex() ).thenAnswer( new ReturnsElementsOf( lexValues ) );
when( lexer.text() ).thenAnswer( new ReturnsElementsOf( textValues ) );
when( lexer.lex() ).thenAnswer( returnsElementsOf( lexValues ) );
when( lexer.text() ).thenAnswer( returnsElementsOf( textValues ) );
when( lexer.getLine() ).thenReturn( -1 );
}
}
Expand Down