github.com/eagleql/xray-core@v1.4.4/infra/conf/reverse_test.go (about)

     1  package conf_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/eagleql/xray-core/app/reverse"
     7  	"github.com/eagleql/xray-core/infra/conf"
     8  )
     9  
    10  func TestReverseConfig(t *testing.T) {
    11  	creator := func() conf.Buildable {
    12  		return new(conf.ReverseConfig)
    13  	}
    14  
    15  	runMultiTestCase(t, []TestCase{
    16  		{
    17  			Input: `{
    18  				"bridges": [{
    19  					"tag": "test",
    20  					"domain": "test.example.com"
    21  				}]
    22  			}`,
    23  			Parser: loadJSON(creator),
    24  			Output: &reverse.Config{
    25  				BridgeConfig: []*reverse.BridgeConfig{
    26  					{Tag: "test", Domain: "test.example.com"},
    27  				},
    28  			},
    29  		},
    30  		{
    31  			Input: `{
    32  				"portals": [{
    33  					"tag": "test",
    34  					"domain": "test.example.com"
    35  				}]
    36  			}`,
    37  			Parser: loadJSON(creator),
    38  			Output: &reverse.Config{
    39  				PortalConfig: []*reverse.PortalConfig{
    40  					{Tag: "test", Domain: "test.example.com"},
    41  				},
    42  			},
    43  		},
    44  	})
    45  }