github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/client/api/api_test.go (about)

     1  package api
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  )
     7  
     8  func TestBasicCall(t *testing.T) {
     9  	if v := os.Getenv("IN_TRAVIS_CI"); v == "yes" {
    10  		return
    11  	}
    12  
    13  	response := map[string]interface{}{}
    14  	if err := NewClient(&Options{
    15  		Token: os.Getenv("MICRO_API_TOKEN"),
    16  	}).Call("helloworld", "call", map[string]interface{}{
    17  		"name": "Alice",
    18  	}, &response); err != nil {
    19  		t.Fatal(err)
    20  	}
    21  	if len(response) > 0 {
    22  		t.Fatal(len(response))
    23  	}
    24  }