Skip to content

Add MockServer::new_http() and MockServer::new_grpc() to specify the server type more explicitly#53

Merged
declark1 merged 5 commits intoIBM:mainfrom
declark1:add-mockserver-constructors
Jul 11, 2025
Merged

Add MockServer::new_http() and MockServer::new_grpc() to specify the server type more explicitly#53
declark1 merged 5 commits intoIBM:mainfrom
declark1:add-mockserver-constructors

Conversation

@declark1
Copy link
Contributor

@declark1 declark1 commented Jul 11, 2025

This PR adds new constructor methods to MockServer to specify the server type more explicitly: MockServer::new_http() and MockServer::new_grpc().

Previously, the grpc() builder method was used to set the server type to gRPC, e.g. MockServer::new().grpc(), which is a bit weird in this case. On a couple of occasions, I forgot to set .grpc() for gRPC mock servers, resulting in improper handling.

MockServer::new() is unchanged and still creates a HTTP mock server. The grpc() builder method has been deprecated in favor of MockServer::new_grpc().

This also prepares version 0.3.0 and drops the "alpha" suffix from the version. 0.* will be considered alpha.

Closes #52

declark1 added 5 commits July 11, 2025 12:03
…lear new clippy warnings

Signed-off-by: declark1 <44146800+declark1@users.noreply.github.com>
Signed-off-by: declark1 <44146800+declark1@users.noreply.github.com>
Signed-off-by: declark1 <44146800+declark1@users.noreply.github.com>
Signed-off-by: declark1 <44146800+declark1@users.noreply.github.com>
Signed-off-by: declark1 <44146800+declark1@users.noreply.github.com>
Copy link
Contributor

@mdevino mdevino left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@declark1 declark1 merged commit 0ca52ec into IBM:main Jul 11, 2025
2 checks passed
@declark1 declark1 deleted the add-mockserver-constructors branch July 11, 2025 19:40
@declark1 declark1 changed the title Add MockServer::new_http() and MockServer::new_grpc() Add MockServer::new_http() and MockServer::new_grpc() to specify the server type more explicitly Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make MockServer type setting more explicit

2 participants