github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/infra/conf/mtproto_test.go (about) 1 package conf_test 2 3 import ( 4 "testing" 5 6 "v2ray.com/core/common/protocol" 7 "v2ray.com/core/common/serial" 8 . "v2ray.com/core/infra/conf" 9 "v2ray.com/core/proxy/mtproto" 10 ) 11 12 func TestMTProtoServerConfig(t *testing.T) { 13 creator := func() Buildable { 14 return new(MTProtoServerConfig) 15 } 16 17 runMultiTestCase(t, []TestCase{ 18 { 19 Input: `{ 20 "users": [{ 21 "email": "love@v2ray.com", 22 "level": 1, 23 "secret": "b0cbcef5a486d9636472ac27f8e11a9d" 24 }] 25 }`, 26 Parser: loadJSON(creator), 27 Output: &mtproto.ServerConfig{ 28 User: []*protocol.User{ 29 { 30 Email: "love@v2ray.com", 31 Level: 1, 32 Account: serial.ToTypedMessage(&mtproto.Account{ 33 Secret: []byte{176, 203, 206, 245, 164, 134, 217, 99, 100, 114, 172, 39, 248, 225, 26, 157}, 34 }), 35 }, 36 }, 37 }, 38 }, 39 }) 40 }