// create a new user.
create a new user.
// create a new user .
func createUser(t *testing.T, k *Keycloak, realm string, username string) string {
	t.Helper()
	user := &User{
		Enabled:   Bool(true),
		Username:  String(username),
		Email:     String(username + "@email.com"),
		FirstName: String("first"),
		LastName:  String("last"),
	}
	res, err := k.Users.Create(context.Background(), realm, user)
	if err != nil {
		t.Errorf("Users.Create returned error: %v", err)
	}
	parts := strings.Split(res.Header.Get("Location"), "/")
	userID := parts[len(parts)-1]
	return userID
}
func createUser ( t * testing . T , k * Keycloak , realm string , username string ) string { t . Helper ( ) user := & User { Enabled : Bool ( true ) , Username : String ( username ) , Email : String ( username + " " ) , FirstName : String ( " " ) , LastName : String ( " " ) , } res , err := k . Users . Create ( context . Background ( ) , realm , user ) if err != nil { t . Errorf ( " " , err ) } parts := strings . Split ( res . Header . Get ( " " ) , " " ) userID := parts [ len ( parts ) - 1 ] return userID }
create a new user.
create a new user .