-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: corrected duplicate step when using interface for #2757
- Loading branch information
Julien Kronegg
committed
May 19, 2023
1 parent
b53204e
commit d31a8bc
Showing
5 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
cucumber-java/src/test/java/io/cucumber/java/stepswithinterface/StepsInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.cucumber.java.stepswithinterface; | ||
|
||
public interface StepsInterface { | ||
|
||
Number test(); | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
cucumber-java/src/test/java/io/cucumber/java/stepswithinterface/StepsWithInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.cucumber.java.stepswithinterface; | ||
|
||
import io.cucumber.java.en.Given; | ||
|
||
/** | ||
* Having a class which implements a parent class will lead to duplicate the | ||
* methods which return specialized type (here Number for the interface and | ||
* Integer for the subclass). The original method has a "volatile" modifier. | ||
*/ | ||
public class StepsWithInterface implements StepsInterface { | ||
|
||
@Given("test") | ||
public Integer test() { | ||
return 1; | ||
} | ||
|
||
} |