micro/client/mucp/mucp_request_test.go
Vasiliy Tolstov 06136312bb
regen files with never protoc (#6)
* regen files with never protoc
* rewrite import path

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2020-08-19 17:47:17 +03:00

26 lines
697 B
Go

package mucp
import (
"testing"
"github.com/unistack-org/micro/v3/client"
)
func TestRequestOptions(t *testing.T) {
r := newRequest("service", "endpoint", nil, "application/json")
if r.Service() != "service" {
t.Fatalf("expected 'service' got %s", r.Service())
}
if r.Endpoint() != "endpoint" {
t.Fatalf("expected 'endpoint' got %s", r.Endpoint())
}
if r.ContentType() != "application/json" {
t.Fatalf("expected 'endpoint' got %s", r.ContentType())
}
r2 := newRequest("service", "endpoint", nil, "application/json", client.WithContentType("application/protobuf"))
if r2.ContentType() != "application/protobuf" {
t.Fatalf("expected 'endpoint' got %s", r2.ContentType())
}
}