Skip to content

Commit

Permalink
Go module support (v3)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartin82 committed Jun 23, 2020
1 parent 0610f2e commit 59f19e7
Show file tree
Hide file tree
Showing 31 changed files with 166 additions and 68 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,13 @@ You can always disable this behavior adding the following flag `-server-statisti

### Contributing

Clone this repository to ```$GOPATH/src/github.com/jmartin82/mmock``` and type ```go get .```.
As of version 3.0.0, Mmock is available as a Go module. Therefore a Go version capable of understanding /vN suffixed imports is required:

Requires Go 1.12+ to build.
1.9.7+
1.10.3+
1.11+

If you make any changes, run ```go fmt ./...``` before submitting a pull request.
If you make any changes, please run ```go fmt ./...``` before submitting a pull request.

### Licence

Expand Down
20 changes: 10 additions & 10 deletions cmd/mmock/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import (
"path/filepath"
"strings"

"github.com/jmartin82/mmock/internal/config"
"github.com/jmartin82/mmock/internal/config/parser"
"github.com/jmartin82/mmock/internal/console"
"github.com/jmartin82/mmock/internal/server"
"github.com/jmartin82/mmock/internal/statistics"
"github.com/jmartin82/mmock/pkg/match"
"github.com/jmartin82/mmock/pkg/match/payload"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/pkg/vars"
"github.com/jmartin82/mmock/pkg/vars/fake"
"github.com/jmartin82/mmock/v3/internal/config"
"github.com/jmartin82/mmock/v3/internal/config/parser"
"github.com/jmartin82/mmock/v3/internal/console"
"github.com/jmartin82/mmock/v3/internal/server"
"github.com/jmartin82/mmock/v3/internal/statistics"
"github.com/jmartin82/mmock/v3/pkg/match"
"github.com/jmartin82/mmock/v3/pkg/match/payload"
"github.com/jmartin82/mmock/v3/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/vars"
"github.com/jmartin82/mmock/v3/pkg/vars/fake"
)

//VERSION of the application
Expand Down
27 changes: 27 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module github.com/jmartin82/mmock/v3

go 1.14

require (
github.com/azer/url-router v0.0.0-20140924232216-1a0aa252538c
github.com/basgys/goxml2json v1.1.0
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/corpix/uarand v0.1.1 // indirect
github.com/elazarl/go-bindata-assetfs v1.0.0
github.com/ghodss/yaml v1.0.0
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428
github.com/joeljunstrom/go-luhn v0.0.0-20190413165225-1e071b33b576
github.com/kr/pretty v0.2.0 // indirect
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/gommon v0.3.0 // indirect
github.com/myesui/uuid v1.0.0 // indirect
github.com/radovskyb/watcher v1.0.7
github.com/ryanuber/go-glob v1.0.0
github.com/stathat/go v1.0.0
github.com/tidwall/gjson v1.6.0
github.com/twinj/uuid v1.0.0
golang.org/x/net v0.0.0-20200602114024-627f9648deb9
gopkg.in/stretchr/testify.v1 v1.2.2 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
82 changes: 82 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
github.com/Masterminds/glide v0.13.2/go.mod h1:STyF5vcenH/rUqTEv+/hBXlSTo7KYwg2oc2f4tzPWic=
github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA=
github.com/azer/url-router v0.0.0-20140924232216-1a0aa252538c h1:vpYPra7G75NhuxN28VqQhTepM8a6c201AsJWdRaINqY=
github.com/azer/url-router v0.0.0-20140924232216-1a0aa252538c/go.mod h1:YT0FE3RD8ecPJBNkCdpeEAdZXPZgD2CqcRtpwuzjt9M=
github.com/basgys/goxml2json v1.1.0 h1:4ln5i4rseYfXNd86lGEB+Vi652IsIXIvggKM/BhUKVw=
github.com/basgys/goxml2json v1.1.0/go.mod h1:wH7a5Np/Q4QoECFIU8zTQlZwZkrilY0itPfecMw41Dw=
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428 h1:Mo9W14pwbO9VfRe+ygqZ8dFbPpoIK1HFrG/zjTuQ+nc=
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428/go.mod h1:uhpZMVGznybq1itEKXj6RYw9I71qK4kH+OGMjRC4KEo=
github.com/joeljunstrom/go-luhn v0.0.0-20190413165225-1e071b33b576 h1:k82KNEG8vk59eHv/8xwBUh4dSR/t1wPiht4aDJm0SOY=
github.com/joeljunstrom/go-luhn v0.0.0-20190413165225-1e071b33b576/go.mod h1:pE5zuSeg07RZZfWS158WpV7oUWb1++8T2jZ/UklLM3E=
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/myesui/uuid v1.0.0 h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI=
github.com/myesui/uuid v1.0.0/go.mod h1:2CDfNgU0LR8mIdO8vdWd8i9gWWxLlcoIGGpSNgafq84=
github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/radovskyb/watcher v1.0.7/go.mod h1:78okwvY5wPdzcb1UYnip1pvrZNIVEIh/Cm+ZuvsUYIg=
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/stathat/go v1.0.0 h1:HFIS5YkyaI6tXu7JXIRRZBLRvYstdNZm034zcCeaybI=
github.com/stathat/go v1.0.0/go.mod h1:+9Eg2szqkcOGWv6gfheJmBBsmq9Qf5KDbzy8/aYYR0c=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/tidwall/gjson v1.6.0 h1:9VEQWz6LLMUsUl6PueE49ir4Ka6CzLymOAZDxpFsTDc=
github.com/tidwall/gjson v1.6.0/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/twinj/uuid v1.0.0 h1:fzz7COZnDrXGTAOHGuUGYd6sG+JMq+AoE7+Jlu0przk=
github.com/twinj/uuid v1.0.0/go.mod h1:mMgcE1RHFUFqe5AfiwlINXisXfDGro23fWdPUfOMjRY=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/stretchr/testify.v1 v1.2.2 h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M=
gopkg.in/stretchr/testify.v1 v1.2.2/go.mod h1:QI5V/q6UbPmuhtm10CaFZxED9NreB8PnFYN9JcR6TxU=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
2 changes: 1 addition & 1 deletion internal/config/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package config
import (
"encoding/json"
"errors"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"io/ioutil"
"log"
"reflect"
Expand Down
2 changes: 1 addition & 1 deletion internal/config/filesystem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package config

import (
"errors"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"io/ioutil"
"os"
"path/filepath"
Expand Down
2 changes: 1 addition & 1 deletion internal/config/mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"sync"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

var ErrFilePathIsNotUnderConfigPath = errors.New("File path is not under config path")
Expand Down
2 changes: 1 addition & 1 deletion internal/config/mapping_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

import (
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"io/ioutil"
"os"
"path/filepath"
Expand Down
4 changes: 1 addition & 3 deletions internal/config/parser/json_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package parser

import (
"encoding/json"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"path/filepath"
"strings"


)

//JSONReader struct created to read json config files
Expand Down
2 changes: 1 addition & 1 deletion internal/config/parser/yaml_reader.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package parser

import (
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"path/filepath"
"strings"

Expand Down
8 changes: 4 additions & 4 deletions internal/console/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"strings"

assetfs "github.com/elazarl/go-bindata-assetfs"
"github.com/jmartin82/mmock/internal/config"
"github.com/jmartin82/mmock/pkg/match"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/internal/config"
"github.com/jmartin82/mmock/v3/pkg/match"
"github.com/jmartin82/mmock/v3/pkg/mock"

"github.com/jmartin82/mmock/internal/statistics"
"github.com/jmartin82/mmock/v3/internal/statistics"
"github.com/labstack/echo"
"golang.org/x/net/websocket"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package proxy

import (
"bytes"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"io/ioutil"
"log"
"net/http"
Expand Down
2 changes: 1 addition & 1 deletion internal/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"testing"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

type MockClient struct {
Expand Down
10 changes: 5 additions & 5 deletions internal/server/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import (
"strconv"
"time"

"github.com/jmartin82/mmock/internal/proxy"
"github.com/jmartin82/mmock/pkg/match"
"github.com/jmartin82/mmock/v3/internal/proxy"
"github.com/jmartin82/mmock/v3/pkg/match"

"net/url"
"regexp"
"strings"

"github.com/jmartin82/mmock/internal/statistics"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/pkg/vars"
"github.com/jmartin82/mmock/v3/internal/statistics"
"github.com/jmartin82/mmock/v3/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/vars"
)

//Dispatcher is the mock http server
Expand Down
2 changes: 1 addition & 1 deletion internal/server/handle_callback.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"time"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

// HandleCallback makes a callback required after a request
Expand Down
2 changes: 1 addition & 1 deletion internal/server/handle_callback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http/httptest"
"testing"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

func makeTestServer(allowedMethod string, successResponse string, t *testing.T) *httptest.Server {
Expand Down
6 changes: 3 additions & 3 deletions internal/server/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

"log"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/internal/config"
"github.com/jmartin82/mmock/v3/internal/config"
"github.com/jmartin82/mmock/v3/pkg/mock"

"github.com/jmartin82/mmock/pkg/match"
"github.com/jmartin82/mmock/v3/pkg/match"
)

//RequestResolver contains the functions to check the http request and return the matching mock.
Expand Down
4 changes: 1 addition & 3 deletions internal/server/router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ package server

import (
"errors"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
"testing"


)

type DummyMatcher struct {
Expand Down
7 changes: 2 additions & 5 deletions pkg/match/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package match
import (
"errors"
"fmt"
"github.com/jmartin82/mmock/pkg/match/payload"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/match/payload"
"github.com/jmartin82/mmock/v3/pkg/mock"
"strings"

urlmatcher "github.com/azer/url-router"
Expand All @@ -18,8 +18,6 @@ var (
ErrPathNotMatch = errors.New("Path not match")
)



func NewTester(comparator *payload.Comparator, scenario ScenearioStorer) *Request {
return &Request{scenario: scenario, comparator: comparator}
}
Expand Down Expand Up @@ -137,7 +135,6 @@ type Matcher interface {
Match(req *mock.Request, mock *mock.Definition, scenarioAware bool) (bool, error)
}


func (mm Request) Match(req *mock.Request, mock *mock.Definition, scenarioAware bool) (bool, error) {

routes := urlmatcher.New(mock.Request.Path)
Expand Down
5 changes: 2 additions & 3 deletions pkg/match/request_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package match

import (
"github.com/jmartin82/mmock/pkg/match/payload"
"github.com/jmartin82/mmock/v3/pkg/match/payload"
"testing"

"github.com/jmartin82/mmock/pkg/mock"

"github.com/jmartin82/mmock/v3/pkg/mock"
)

func TestMatchMethod(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/match/spy.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package match

import (
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

type TransactionSpier interface {
Expand Down
4 changes: 2 additions & 2 deletions pkg/match/spy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package match
import (
"testing"

"github.com/jmartin82/mmock/pkg/match/payload"
"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/match/payload"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

type DummyScenarioManager struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/match/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package match
import (
"time"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

//Error contains the tested uri and the match error
Expand Down
2 changes: 1 addition & 1 deletion pkg/match/transaction_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package match
import (
"sync"

"github.com/jmartin82/mmock/pkg/mock"
"github.com/jmartin82/mmock/v3/pkg/mock"
)

type TransactionStorer interface {
Expand Down
Loading

0 comments on commit 59f19e7

Please sign in to comment.