-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Mockito tests out into a separate module
Closes gh-260
- Loading branch information
1 parent
f2c3e52
commit b6d60e1
Showing
7 changed files
with
113 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Tests if Spring Boot's TestContext Framework's Mockito support is working |
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,28 @@ | ||
plugins { | ||
id "java" | ||
id "org.springframework.boot" | ||
id "org.springframework.aot.smoke-test" | ||
id "org.graalvm.buildtools.native" | ||
} | ||
|
||
dependencies { | ||
implementation(enforcedPlatform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) | ||
implementation("org.springframework.boot:spring-boot-starter") | ||
|
||
testImplementation("org.springframework.boot:spring-boot-starter-test") | ||
|
||
appTestImplementation(project(":aot-smoke-test-support")) | ||
} | ||
|
||
aotSmokeTest { | ||
nativeTest { | ||
expectedToFail { | ||
becauseOf "https://github.com/spring-projects/spring-boot/issues/32195" | ||
} | ||
} | ||
test { | ||
expectedToFail { | ||
becauseOf "https://github.com/spring-projects/spring-boot/issues/32195" | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
...oot-tcf-mockito/src/main/java/com/example/boot/tcf/mockito/BootTcfMockitoApplication.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,31 @@ | ||
/* | ||
* Copyright 2022-2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.example.boot.tcf.mockito; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class BootTcfMockitoApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication application = new SpringApplication(BootTcfMockitoApplication.class); | ||
System.setProperty("main.ran", "true"); | ||
application.run(args); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
boot/boot-tcf-mockito/src/main/java/com/example/boot/tcf/mockito/MyComponentImpl.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,28 @@ | ||
/* | ||
* Copyright 2022-2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.example.boot.tcf.mockito; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
class MyComponentImpl { | ||
|
||
int value() { | ||
return 1; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
boot/boot-tcf-mockito/src/main/java/com/example/boot/tcf/mockito/MyComponentInterface.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,23 @@ | ||
/* | ||
* Copyright 2022-2025 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.example.boot.tcf.mockito; | ||
|
||
interface MyComponentInterface { | ||
|
||
int value(); | ||
|
||
} |
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