Skip to content

Commit a1c2b04

Browse files
committed
Move grpc test out of spring-boot-test-autoconfigure
Moves the grpc test code into its own module (`spring-boot-grc-test`) due to the modularization of the test module. Signed-off-by: onobc <[email protected]>
1 parent 42af221 commit a1c2b04

File tree

13 files changed

+64
-12
lines changed

13 files changed

+64
-12
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright 2012-present the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the License);
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
plugins {
18+
id "java-library"
19+
id "org.springframework.boot.deployed"
20+
id "org.springframework.boot.optional-dependencies"
21+
}
22+
23+
description = "Spring Boot gRPC Test"
24+
25+
dependencies {
26+
api(project(":module:spring-boot-grpc-client"))
27+
api(project(":module:spring-boot-grpc-server"))
28+
29+
implementation(project(":core:spring-boot-test"))
30+
31+
optional(project(":module:spring-boot-test-autoconfigure"))
32+
optional("io.grpc:grpc-inprocess")
33+
optional("io.grpc:grpc-stub")
34+
optional("org.junit.jupiter:junit-jupiter-api")
35+
36+
testImplementation(project(":test-support:spring-boot-test-support"))
37+
testImplementation("io.grpc:grpc-netty")
38+
39+
testRuntimeOnly("ch.qos.logback:logback-classic")
40+
//testRuntimeOnly("tools.jackson.core:jackson-databind")
41+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.autoconfigure.grpc;
17+
package org.springframework.boot.grpc.test.autoconfigure;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
@@ -48,6 +48,7 @@
4848
* Whether to start an in-process test gRPC server. Defaults to {@code true}.
4949
* @return whether to start an in-process gRPC server
5050
*/
51+
@SuppressWarnings("unused")
5152
boolean enabled() default true;
5253

5354
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.autoconfigure.grpc;
17+
package org.springframework.boot.grpc.test.autoconfigure;
1818

1919
import java.time.Duration;
2020
import java.util.Collections;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.autoconfigure.grpc;
17+
package org.springframework.boot.grpc.test.autoconfigure;
1818

1919
import java.util.List;
2020
import java.util.Objects;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.autoconfigure.grpc;
17+
package org.springframework.boot.grpc.test.autoconfigure;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.autoconfigure.grpc;
17+
package org.springframework.boot.grpc.test.autoconfigure;
1818

1919
import java.util.HashMap;
2020
import java.util.Map;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
* Auto-configuration for Spring gRPC tests.
1919
*/
2020
@NullMarked
21-
package org.springframework.boot.test.autoconfigure.grpc;
21+
package org.springframework.boot.grpc.test.autoconfigure;
2222

2323
import org.jspecify.annotations.NullMarked;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Spring Test Context Customizer Factories
2+
org.springframework.test.context.ContextCustomizerFactory=\
3+
org.springframework.boot.grpc.test.autoconfigure.InProcessTransportContextCustomizerFactory
4+
5+
# Application Context Initializers
6+
org.springframework.context.ApplicationContextInitializer=\
7+
org.springframework.boot.grpc.test.autoconfigure.ServerPortInfoApplicationContextInitializer
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.grpc.test.autoconfigure.InProcessTestAutoConfiguration
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.test.autoconfigure.grpc;
17+
package org.springframework.boot.grpc.test.autoconfigure;
1818

1919
import io.grpc.BindableService;
2020
import io.grpc.ServerServiceDefinition;

0 commit comments

Comments
 (0)