Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import org.springframework.boot.test.system.CapturedOutput;
import org.springframework.boot.test.system.OutputCaptureExtension;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.grpc.server.NettyGrpcServerFactory;
import org.springframework.test.annotation.DirtiesContext;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -98,17 +96,6 @@ public void streamHello(HelloRequest request,
}
};
}

/**
* Override the Netty server factory to return null, preventing Netty server creation.
* @return null to disable Netty server
*/
@Bean
@Primary
NettyGrpcServerFactory nettyGrpcServerFactory() {
return null;
}

}

}
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,11 @@ project('grpc-client') {
//Test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation "org.springframework.grpc:spring-grpc-test"

configurations {
testImplementation.exclude group: 'io.grpc', module: 'grpc-netty'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think testRumtimeOnly should be enough.
I guess we need it for the client part to connect anyway at runtime .
Or just come back to named channel in test props !

testRuntimeOnly.exclude group: 'io.grpc', module: 'grpc-netty'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this means that spring.grpc.test.inprocess.exclusive=true is not that exclusive in reality since there is still auto-configured respective channel factory which confuses our sample configuration when we run the test.
Just a question seeking the truth behind change which feels unnecessary.
Thanks

}
}


Expand Down
Loading