Created
May 1, 2023 09:25
-
-
Save disegmvm/64393777c7c43e7b130e0d452a04ecc9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func startProvider() { | |
main() | |
} | |
func TestServerPact_Verification(t *testing.T) { | |
go startProvider() | |
var dir, _ = os.Getwd() | |
var pactDir = fmt.Sprintf("%s/../client/pacts", dir) | |
var logDir = fmt.Sprintf("%s/log", dir) | |
pact := &dsl.Pact{ | |
Provider: "Sample Provider", | |
LogDir: logDir, | |
PactDir: pactDir, | |
DisableToolValidityCheck: true, | |
} | |
_, err := pact.VerifyProvider(t, types.VerifyRequest{ | |
ProviderBaseURL: "http://127.0.0.1:8080", | |
PactURLs: []string{"../client/pacts/sample_consumer-sample_provider.json"}, | |
}) | |
if err != nil { | |
t.Fatal(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment