forked from micronaut-projects/micronaut-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression where AliasFor is no longer recursive (micronaut-proje…
…cts#8746) --------- Co-authored-by: Denis Stepanov <denis.s.stepanov@oracle.com>
Access has been restricted
You have triggered a rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
1 parent
80a8749
commit 0d9d9e0
Showing
10 changed files
with
193 additions
and
25 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
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
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
46 changes: 46 additions & 0 deletions
46
test-suite/src/test/groovy/io/micronaut/test/replacesbug/MathInnerServiceSpec.groovy
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,46 @@ | ||
package io.micronaut.test.replacesbug | ||
|
||
import io.micronaut.test.extensions.spock.annotation.MicronautTest | ||
import io.micronaut.test.annotation.MockBean | ||
import jakarta.inject.Singleton | ||
import spock.lang.Specification | ||
|
||
import jakarta.inject.Inject | ||
|
||
@MicronautTest | ||
class MathInnerServiceSpec extends Specification { | ||
|
||
@Inject | ||
MathService mathService | ||
|
||
void "should compute use inner mock"() { | ||
when: | ||
def result = mathService.compute(10) | ||
|
||
then: | ||
result == 50 | ||
} | ||
|
||
@MockBean(MathService) | ||
static class MyMock implements MathService { | ||
|
||
@Override | ||
Integer compute(Integer num) { | ||
return 50 | ||
} | ||
} | ||
} | ||
|
||
interface MathService { | ||
|
||
Integer compute(Integer num); | ||
} | ||
|
||
@Singleton | ||
class MathServiceImpl implements MathService { | ||
|
||
@Override | ||
Integer compute(Integer num) { | ||
return num * 4 // should never be called | ||
} | ||
} |