MCPcopy Create free account
hub / github.com/conforma/cli / String

Method String

acceptance/wiremock/wiremock.go:141–156  ·  view source on GitHub ↗

String formats the unmatched request and generates a snippet to help stub the request, useful when reporting unmatched requests i.e. those that have been received but no stubbing was defined

()

Source from the content-addressed store, hash-verified

139// stub the request, useful when reporting unmatched requests i.e. those
140// that have been received but no stubbing was defined
141func (u unmatchedRequest) String() string {
142 str := fmt.Sprintf("Found unmatched %s request to %s\n", u.Method, u.URL)
143
144 if u.Body != "" {
145 str += "The request contained this HTTP body:\n" + u.Body
146 }
147
148 str += fmt.Sprintf(`Stub it by adding:
149wiremock.StubFor(ctx, wiremock.%s(wiremock.URLPathEqualTo("%s")).
150 WillReturnResponse(wiremock.NewResponse().WithBody("<body>").WithHeaders(
151 map[string]string{"Content-Type": "%s"},
152 ).WithStatus(200)
153 ))`, strings.ToTitle(strings.ToLower(u.Method)), u.URL, contentTypeFrom(u))
154
155 return str
156}
157
158// UnmatchedRequests queries the WireMock admin API for any unmatched requests
159// i.e. those that have been received but no stubbing was defined and returns

Callers 15

acceptance_test.goFile · 0.45
runConftestFunction · 0.45
assertImageContentFunction · 0.45
getImageDigestAndRefFunction · 0.45
getDigestRefForImageFunction · 0.45
createAndPushLayerFunction · 0.45
createAndPushPlainImageFunction · 0.45

Calls 1

contentTypeFromFunction · 0.85

Tested by

no test coverage detected