Skip to content

Commit 8c6c723

Browse files
committed
fixing test errors
1 parent 73fb170 commit 8c6c723

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericListVisitorAdapterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ void visit_GivenConstructorDeclaration() {
617617
ConstructorDeclaration node = mock(ConstructorDeclaration.class);
618618

619619
// When
620-
Mockito.when(node.getBody()).thenReturn(mock(BlockStmt.class));
620+
Mockito.when(node.getBody()).thenReturn(Optional.of(mock(BlockStmt.class)));
621621
Mockito.when(node.getModifiers()).thenReturn(mock(NodeList.class));
622622
Mockito.when(node.getName()).thenReturn(mock(SimpleName.class));
623623
Mockito.when(node.getParameters()).thenReturn(mock(NodeList.class));

javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/GenericVisitorAdapterTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ void visit_GivenConstructorDeclaration() {
615615
ConstructorDeclaration node = mock(ConstructorDeclaration.class);
616616

617617
// When
618-
Mockito.when(node.getBody()).thenReturn(mock(BlockStmt.class));
618+
Mockito.when(node.getBody()).thenReturn(Optional.of(mock(BlockStmt.class)));
619619
Mockito.when(node.getModifiers()).thenReturn(mock(NodeList.class));
620620
Mockito.when(node.getName()).thenReturn(mock(SimpleName.class));
621621
Mockito.when(node.getParameters()).thenReturn(mock(NodeList.class));
@@ -1832,6 +1832,7 @@ void visit_GivenThisExpr() {
18321832
Mockito.when(node.getTypeName()).thenReturn(Optional.of(mock(Name.class)));
18331833
Mockito.when(node.getComment()).thenReturn(Optional.of(mock(Comment.class)));
18341834

1835+
18351836
// Then
18361837
Object result = visitor.visit(node, argument);
18371838

javaparser-core-testing/src/test/java/com/github/javaparser/ast/visitor/HashCodeVisitorTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ void testVisitConstructorDeclaration() {
281281
verify(node, times(1)).getTypeParameters();
282282
verify(node, times(1)).getAnnotations();
283283
verify(node, times(1)).getComment();
284+
//JML
285+
verify(node, times(1)).getContracts();
284286
}
285287

286288
@Test
@@ -298,6 +300,8 @@ void testVisitDoStmt() {
298300
verify(node, times(1)).getBody();
299301
verify(node, times(1)).getCondition();
300302
verify(node, times(1)).getComment();
303+
//JML
304+
verify(node, times(1)).getContracts();
301305
}
302306

303307
@Test
@@ -394,6 +398,8 @@ void testVisitForEachStmt() {
394398
verify(node, times(1)).getIterable();
395399
verify(node, times(1)).getVariable();
396400
verify(node, times(1)).getComment();
401+
//JML
402+
verify(node, times(1)).getContracts();
397403
}
398404

399405
@Test
@@ -491,6 +497,8 @@ void testVisitLambdaExpr() {
491497
verify(node, times(1)).isEnclosingParameters();
492498
verify(node, times(1)).getParameters();
493499
verify(node, times(1)).getComment();
500+
//JML
501+
verify(node, times(1)).getContracts();
494502
}
495503

496504
@Test
@@ -567,6 +575,8 @@ void testVisitMethodDeclaration() {
567575
verify(node, times(1)).getTypeParameters();
568576
verify(node, times(1)).getAnnotations();
569577
verify(node, times(1)).getComment();
578+
//JML
579+
verify(node, times(1)).getContracts();
570580
}
571581

572582
@Test

javaparser-core-testing/src/test/java/com/github/javaparser/key/KeYParsingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class KeYParsingTests {
1212
@Test
1313
void testGhostModifier() {
14-
Statement x = StaticJavaParser.parseStatement("ghost int x;");
14+
Statement x = StaticJavaParser.parseStatement("/*@ ghost */ int x;");
1515
}
1616

1717
@Test

javaparser-core/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,4 @@ public boolean remove(Node node) {
390390
}
391391
return super.remove(node);
392392
}
393-
394-
@Override
395-
public NodeList<JmlContract> getContracts() {
396-
return null;
397-
}
398-
399-
@Override
400-
public ConstructorDeclaration setContracts(NodeList<JmlContract> contracts) {
401-
return null;
402-
}
403393
}

0 commit comments

Comments
 (0)