github.com/TIBCOSoftware/flogo-lib@v0.5.9/app/resource/config_test.go (about)

     1  package resource
     2  
     3  import (
     4  	"encoding/json"
     5  	"fmt"
     6  	"testing"
     7  
     8  	"github.com/stretchr/testify/assert"
     9  )
    10  
    11  const resJSON = `
    12  {
    13    "resources":
    14    [
    15      {
    16        "id": "flow:myflow",
    17        "data":{
    18        }
    19      },
    20      {
    21        "id": "schema:myschema",
    22        "data":{
    23        }
    24      },
    25      {
    26        "id": "connection:myConnection",
    27        "data":{
    28        }
    29      }
    30    ]
    31  }
    32  `
    33  
    34  func TestDeserialize(t *testing.T) {
    35  
    36  	defRep := &ResourcesConfig{}
    37  
    38  	err := json.Unmarshal([]byte(resJSON), defRep)
    39  	assert.Nil(t, err)
    40  
    41  	fmt.Printf("Resources: %v", defRep)
    42  }