-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify and Merge protocol test request unit tests codegen logic #447
Conversation
writer.addUseImports(SmithyGoDependency.CONTEXT); | ||
writer.write("result, err := $L.$T(context.Background(), c.Params)", clientName, opSymbol); | ||
writer.openBlock("result, err := $L.$T(context.Background(), c.Params, func(options *Options) {", "})", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: in the future, we should avoid using a series of openBlock
s like this, and just rely on gofmt
to do all the formatting. see something like this
https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointMiddlewareGenerator.java#L266
@@ -282,7 +274,8 @@ protected void generateTestServer( | |||
String name, | |||
Consumer<GoWriter> handler | |||
) { | |||
super.generateTestServer(writer, name, handler); | |||
// We aren't using a test server, but we do need a URL to set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: actually this comment doesnt do a lot of good when its generated. because the generated code wont have this comment. if we can, we should make the URL value even more obvious that its a placeholder (while still being parse-able by whatever needs it). for example, would http://thisisa.placeholder:4242
work?
Modify and Merge protocol test request unit tests codegen logic to isolate cases from local server and instead capture and check request directly via middleware