MCPcopy
hub / github.com/keploy/keploy / replacePortInTestCase

Method replacePortInTestCase

pkg/service/replay/replay.go:3807–3820  ·  view source on GitHub ↗
(testCase *models.TestCase, newPort string)

Source from the content-addressed store, hash-verified

3805}
3806
3807func (r *Replayer) replacePortInTestCase(testCase *models.TestCase, newPort string) error {
3808 var err error
3809 switch testCase.Kind {
3810 case models.HTTP:
3811 testCase.HTTPReq.URL, err = utils.ReplacePort(testCase.HTTPReq.URL, newPort)
3812 case models.GRPC_EXPORT:
3813 testCase.GrpcReq.Headers.PseudoHeaders[":authority"], err = utils.ReplaceGrpcPort(testCase.GrpcReq.Headers.PseudoHeaders[":authority"], newPort)
3814 }
3815 if err != nil {
3816 utils.LogError(r.logger, err, "failed to replace port")
3817 return err
3818 }
3819 return nil
3820}
3821
3822func (r *Replayer) GetSelectedTestSets(ctx context.Context) ([]string, error) {
3823 // get all the testset ids

Callers

nothing calls this directly

Calls 3

ReplacePortFunction · 0.92
ReplaceGrpcPortFunction · 0.92
LogErrorFunction · 0.92

Tested by

no test coverage detected