github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/provider/azure/package_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package azure_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
    10  	gc "gopkg.in/check.v1"
    11  )
    12  
    13  func TestPackage(t *testing.T) {
    14  	gc.TestingT(t)
    15  }
    16  
    17  func toValue[T any](v *T) T {
    18  	if v == nil {
    19  		return *new(T)
    20  	}
    21  	return *v
    22  }
    23  
    24  func toMapPtr(in map[string]string) map[string]*string {
    25  	result := make(map[string]*string)
    26  	for k, v := range in {
    27  		result[k] = to.Ptr(v)
    28  	}
    29  	return result
    30  }
    31  
    32  type keyBundle struct {
    33  	Key *jsonWebKey `json:"key"`
    34  }
    35  
    36  type jsonWebKey struct {
    37  	Kid *string `json:"kid"`
    38  	Kty string  `json:"kty"`
    39  }