Skip to content

Commit

Permalink
fix(utf8): revert utf8 tests until feature fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Mar 19, 2018
1 parent ca50b86 commit b7cea76
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 31 deletions.
6 changes: 4 additions & 2 deletions examples/consumer/goconsumer/user_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ var pact dsl.Pact
var form url.Values
var rr http.ResponseWriter
var req *http.Request
var name = "Jean-Marie de La Beaujardière😀😍"

// var name = "Jean-Marie de La Beaujardière😀😍"
var name = "billy"
var like = dsl.Like
var eachLike = dsl.EachLike
var term = dsl.Term
Expand Down Expand Up @@ -77,7 +79,7 @@ func setup() {

// Login form values
form = url.Values{}
form.Add("username", name)
form.Add("username", "billy")
form.Add("password", "issilly")

// Create a request to pass to our handler.
Expand Down
6 changes: 3 additions & 3 deletions examples/gin/provider/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type Login struct {

var userRepository = &types.UserRepository{
Users: map[string]*types.User{
"Jean-Marie de La Beaujardière😀😍": &types.User{
Name: "Jean-Marie de La Beaujardière😀😍",
Username: "Jean-Marie de La Beaujardière😀😍",
"billy": &types.User{
Name: "billy",
Username: "billy",
Password: "issilly",
Type: "admin",
},
Expand Down
22 changes: 15 additions & 7 deletions examples/gin/provider/user_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

// The actual Provider test itself
func TestPact_GinProvider(t *testing.T) {
func TestPact_Provider(t *testing.T) {
go startInstrumentedProvider()

pact := createPact()
Expand Down Expand Up @@ -69,6 +69,14 @@ func TestPact_GinProvider(t *testing.T) {
}
}

func assertExamples(t *testing.T, r types.ProviderVerifierResponse) {
for _, example := range r.Examples {
if example.Status != "passed" {
t.Errorf("%s\n%s\n", example.FullDescription, example.Exception.Message)
}
}
}

// Starts the provider API with hooks for provider states.
// This essentially mirrors the main.go file, with extra routes added.
func startInstrumentedProvider() {
Expand Down Expand Up @@ -103,9 +111,9 @@ var port, _ = utils.GetFreePort()
// Provider States data sets
var billyExists = &examples.UserRepository{
Users: map[string]*examples.User{
"Jean-Marie de La Beaujardière😀😍": &examples.User{
Name: "Jean-Marie de La Beaujardière😀😍",
Username: "Jean-Marie de La Beaujardière😀😍",
"billy": &examples.User{
Name: "billy",
Username: "billy",
Password: "issilly",
Type: "admin",
},
Expand All @@ -116,9 +124,9 @@ var billyDoesNotExist = &examples.UserRepository{}

var billyUnauthorized = &examples.UserRepository{
Users: map[string]*examples.User{
"Jean-Marie de La Beaujardière😀😍": &examples.User{
Name: "Jean-Marie de La Beaujardière😀😍",
Username: "Jean-Marie de La Beaujardière😀😍",
"billy": &examples.User{
Name: "billy",
Username: "billy",
Password: "issilly1",
Type: "blocked",
},
Expand Down
6 changes: 3 additions & 3 deletions examples/go-kit/provider/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ func NewInmemService() Service {
return &userService{
userDatabase: &UserRepository{
users: map[string]*User{
"Jean-Marie de La Beaujardière😀😍": &User{
Name: "Jean-Marie de La Beaujardière😀😍",
username: "Jean-Marie de La Beaujardière😀😍",
"billy": &User{
Name: "billy",
username: "billy",
password: "issilly",
Type: "admin",
},
Expand Down
22 changes: 15 additions & 7 deletions examples/go-kit/provider/user_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ var port, _ = utils.GetFreePort()
// Provider States data sets
var billyExists = &UserRepository{
users: map[string]*User{
"Jean-Marie de La Beaujardière😀😍": &User{
Name: "Jean-Marie de La Beaujardière😀😍",
username: "Jean-Marie de La Beaujardière😀😍",
"billy": &User{
Name: "billy",
username: "billy",
password: "issilly",
Type: "admin",
},
Expand All @@ -42,17 +42,17 @@ var billyDoesNotExist = &UserRepository{}

var billyUnauthorized = &UserRepository{
users: map[string]*User{
"Jean-Marie de La Beaujardière😀😍": &User{
Name: "Jean-Marie de La Beaujardière😀😍",
username: "Jean-Marie de La Beaujardière😀😍",
"billy": &User{
Name: "billy",
username: "billy",
password: "issilly1",
Type: "blocked",
},
},
}

// The actual Provider test itself
func TestPact_GoKitProvider(t *testing.T) {
func TestPact_Provider(t *testing.T) {
go startInstrumentedProvider()

pact := createPact()
Expand Down Expand Up @@ -107,6 +107,14 @@ func TestPact_GoKitProvider(t *testing.T) {
}
}

func assertExamples(t *testing.T, r types.ProviderVerifierResponse) {
for _, example := range r.Examples {
if example.Status != "passed" {
t.Errorf("%s\n%s\n", example.FullDescription, example.Exception.Message)
}
}
}

// Setup the Pact client.
func createPact() dsl.Pact {
return dsl.Pact{
Expand Down
4 changes: 2 additions & 2 deletions examples/mux/provider/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
var userRepository = &types.UserRepository{
Users: map[string]*types.User{
"billy": &types.User{
Name: "Jean-Marie de La Beaujardière😀😍",
Username: "Jean-Marie de La Beaujardière😀😍",
Name: "billy",
Username: "billy",
Password: "issilly",
},
},
Expand Down
22 changes: 15 additions & 7 deletions examples/mux/provider/user_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

// The actual Provider test itself
func TestPact_MuxProvider(t *testing.T) {
func TestPact_Provider(t *testing.T) {
go startInstrumentedProvider()

pact := createPact()
Expand Down Expand Up @@ -73,6 +73,14 @@ func TestPact_MuxProvider(t *testing.T) {
}
}

func assertExamples(t *testing.T, r types.ProviderVerifierResponse) {
for _, example := range r.Examples {
if example.Status != "passed" {
t.Errorf("%s\n%s\n", example.FullDescription, example.Exception.Message)
}
}
}

// Starts the provider API with hooks for provider states.
// This essentially mirrors the main.go file, with extra routes added.
func startInstrumentedProvider() {
Expand Down Expand Up @@ -129,9 +137,9 @@ var port, _ = utils.GetFreePort()
// Provider States data sets
var billyExists = &examples.UserRepository{
Users: map[string]*examples.User{
"Jean-Marie de La Beaujardière😀😍": &examples.User{
Name: "Jean-Marie de La Beaujardière😀😍",
Username: "Jean-Marie de La Beaujardière😀😍",
"billy": &examples.User{
Name: "billy",
Username: "billy",
Password: "issilly",
Type: "admin",
},
Expand All @@ -142,9 +150,9 @@ var billyDoesNotExist = &examples.UserRepository{}

var billyUnauthorized = &examples.UserRepository{
Users: map[string]*examples.User{
"Jean-Marie de La Beaujardière😀😍": &examples.User{
Name: "Jean-Marie de La Beaujardière😀😍",
Username: "Jean-Marie de La Beaujardière😀😍",
"billy": &examples.User{
Name: "billy",
Username: "billy",
Password: "issilly1",
Type: "blocked",
},
Expand Down

0 comments on commit b7cea76

Please sign in to comment.