diff --git a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/BaseServerFactoryPropertyMapper.java b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/DefaultServerFactoryPropertyMapper.java similarity index 81% rename from spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/BaseServerFactoryPropertyMapper.java rename to spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/DefaultServerFactoryPropertyMapper.java index f865c93..34b4fef 100644 --- a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/BaseServerFactoryPropertyMapper.java +++ b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/DefaultServerFactoryPropertyMapper.java @@ -24,23 +24,25 @@ import java.util.function.Consumer; import io.grpc.ServerBuilder; import org.springframework.boot.context.properties.PropertyMapper; +import org.springframework.grpc.server.DefaultGrpcServerFactory; /** - * Helper class used to map {@link GrpcServerProperties} to various {@link ServerBuilder}. + * Helper class used to map {@link GrpcServerProperties} to + * {@link DefaultGrpcServerFactory}. * * @author Chris Bono * @param the type of server builder */ -class BaseServerFactoryPropertyMapper> { +class DefaultServerFactoryPropertyMapper> { final GrpcServerProperties properties; - BaseServerFactoryPropertyMapper(GrpcServerProperties properties) { + DefaultServerFactoryPropertyMapper(GrpcServerProperties properties) { this.properties = properties; } /** - * Maps the properties to the server builder. + * Map the properties to the server factory's server builder. * @param serverBuilder the builder */ void customizeServerBuilder(T serverBuilder) { diff --git a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/NettyServerFactoryPropertyMapper.java b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/NettyServerFactoryPropertyMapper.java index cd7a24a..67f1fd5 100644 --- a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/NettyServerFactoryPropertyMapper.java +++ b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/NettyServerFactoryPropertyMapper.java @@ -18,12 +18,15 @@ package org.springframework.grpc.autoconfigure.server; import io.grpc.netty.NettyServerBuilder; +import org.springframework.grpc.server.NettyGrpcServerFactory; + /** - * Helper class used to map {@link GrpcServerProperties} to {@link NettyServerBuilder}. + * Helper class used to map {@link GrpcServerProperties} to + * {@link NettyGrpcServerFactory}. * * @author Chris Bono */ -class NettyServerFactoryPropertyMapper extends BaseServerFactoryPropertyMapper { +class NettyServerFactoryPropertyMapper extends DefaultServerFactoryPropertyMapper { NettyServerFactoryPropertyMapper(GrpcServerProperties properties) { super(properties); diff --git a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/ShadedNettyServerFactoryPropertyMapper.java b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/ShadedNettyServerFactoryPropertyMapper.java index 012d96a..bd5e104 100644 --- a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/ShadedNettyServerFactoryPropertyMapper.java +++ b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/ShadedNettyServerFactoryPropertyMapper.java @@ -18,13 +18,15 @@ package org.springframework.grpc.autoconfigure.server; import io.grpc.netty.shaded.io.grpc.netty.NettyServerBuilder; +import org.springframework.grpc.server.ShadedNettyGrpcServerFactory; + /** - * Helper class used to map {@link GrpcServerProperties} to the shaded - * {@link NettyServerBuilder}. + * Helper class used to map {@link GrpcServerProperties} to + * {@link ShadedNettyGrpcServerFactory}. * * @author Chris Bono */ -class ShadedNettyServerFactoryPropertyMapper extends BaseServerFactoryPropertyMapper { +class ShadedNettyServerFactoryPropertyMapper extends DefaultServerFactoryPropertyMapper { ShadedNettyServerFactoryPropertyMapper(GrpcServerProperties properties) { super(properties); diff --git a/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/ServerFactoryPropertyMappersTests.java b/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/ServerFactoryPropertyMappersTests.java index ad64890..343b4c5 100644 --- a/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/ServerFactoryPropertyMappersTests.java +++ b/spring-grpc-spring-boot-autoconfigure/src/test/java/org/springframework/grpc/autoconfigure/server/ServerFactoryPropertyMappersTests.java @@ -28,7 +28,7 @@ import static org.mockito.BDDMockito.then; import static org.mockito.Mockito.mock; /** - * Tests for {@link BaseServerFactoryPropertyMapper}, + * Tests for {@link DefaultServerFactoryPropertyMapper}, * {@link NettyServerFactoryPropertyMapper}, and * {@link ShadedNettyServerFactoryPropertyMapper}. * @@ -51,10 +51,10 @@ class ServerFactoryPropertyMappersTests { @Test > void customizeBaseServerBuilder() { T builder = mock(); - customizeServerBuilder(BaseServerFactoryPropertyMapper::new, () -> builder); + customizeServerBuilder(DefaultServerFactoryPropertyMapper::new, () -> builder); } - private , X extends BaseServerFactoryPropertyMapper> void customizeServerBuilder( + private , X extends DefaultServerFactoryPropertyMapper> void customizeServerBuilder( Function mapperFactory, Supplier mockBuilderToCustomize) { GrpcServerProperties properties = new GrpcServerProperties(); properties.getKeepAlive().setTime(Duration.ofHours(1));