You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: application_import_test.go
    path of file: ./repos/cds/engine/api
    
    the code of the file until where you have to start completion: package api

import (
	"bytes"
	"context"
	"io"
	"net/http/httptest"
	"strings"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	yaml "gopkg.in/yaml.v2"

	"github.com/ovh/cds/engine/api/application"
	"github.com/ovh/cds/engine/api/integration"
	"github.com/ovh/cds/engine/api/keys"
	"github.com/ovh/cds/engine/api/test/assets"
	"github.com/ovh/cds/sdk"
	"github.com/ovh/cds/sdk/exportentities"
)

func Test_postApplicationImportHandler_NewAppFromYAMLWithoutSecret(t *testing.T) {
	api, db, _ := newTestAPI(t)

	u, pass := assets.InsertAdminUser(t, db)
	proj := assets.InsertTestProject(t, db, api.Cache, sdk.RandomString(10), sdk.RandomString(10))
	require.NotNil(t, proj)

	//Prepare request
	vars := map[string]string{
		"permProjectKey": 
    
func Test_postApplicationImportHandler_DontOverrideDeploymentPasswordIfNotGiven(t *testing.T) {
	// init test case, create a project with deployment integration then an application with deployment config
	api, db, _ := newTestAPI(t)

	u, pass := assets.InsertAdminUser(t, db)
	proj := assets.InsertTestProject(t, db, api.Cache, sdk.RandomString(10), sdk.RandomString(10))
	require.NotNil(t, proj)

	pfname := sdk.RandomString(10)
	pf := sdk.IntegrationModel{
		Name:       pfname,
		Deployment: true,
		AdditionalDefaultConfig: sdk.IntegrationConfig{
			"token": sdk.IntegrationConfigValue{
				Type:  sdk.IntegrationConfigTypePassword,
				Value: "my-secret-token",
			},
			"url": sdk.IntegrationConfigValue{
				Type:  sdk.IntegrationConfigTypeString,
				Value: "my-url",
			},
		},
	}
	require.NoError(t, integration.InsertModel(db, &pf))
	defer func() { _ = integration.DeleteModel(context.TODO(), db, pf.ID) }()

	pp := sdk.ProjectIntegration{
		Model:              pf,
		Name:               pf.Name,
		IntegrationModelID: pf.ID,
		ProjectID:          proj.ID,
	}
	require.NoError(t, integration.InsertIntegration(db, &pp))

	app := sdk.Application{
		Name: "myNewApp",
	}
	require.NoError(t, application.Insert(db, *proj, &app))

	require.NoError(t, application.SetDeploymentStrategy(db, proj.ID, app.ID, pf.ID, pp.Name, sdk.IntegrationConfig{
		"token": sdk.IntegrationConfigValue{
			Type:  sdk.IntegrationConfigTypePassword,
			Value: "my-secret-token-2",
		},
		"url": sdk.IntegrationConfigValue{
			Type:  sdk.IntegrationConfigTypeString,
			Value: "my-url",
		},
	}))

	// import updated application without deployment token

	appUpdated := exportentities.Application{
		Name: "myNewApp",
		DeploymentStrategies: map[string]map[string]exportentities.VariableValue{
			pp.Name: {
				"url": exportentities.VariableValue{
					Type:  sdk.IntegrationConfigTypeString,
					Value: "my-url-2",
				},
			},
		},
	}

	uri := api.Router.GetRoute("POST", api.postApplicationImportHandler, map[string]string{
		"permProjectKey": proj.Key,
	})
	require.NotEmpty(t, uri)
	req := assets.NewAuthentifiedRequest(t, u, pass, "POST", uri+"?force=true", nil)

	buf, err := yaml.Marshal(appUpdated)
	require.NoError(t, err)
	req.Body = io.NopCloser(bytes.NewReader(buf))
	req.Header.Set("Content-Type", "application/x-yaml")

	rec := httptest.NewRecorder()
	api.Router.Mux.ServeHTTP(rec, req)
	assert.Equal(t, 200, rec.Code)

	t.Logf(">>%s", rec.Body.String())

	// check that the token is still present in the application

	uri = api.Router.GetRoute("GET", api.getApplicationExportHandler, map[string]string{
		"permProjectKey":  proj.Key,
		"applicationName": app.Name,
	})
	require.NotEmpty(t, uri)
	req = assets.NewAuthentifiedRequest(t, u, pass, "GET", uri, nil)

	rec = httptest.NewRecorder()
	api.Router.Mux.ServeHTTP(rec, req)
	assert.Equal(t, 200, rec.Code)

	t.Logf(">>%s", rec.Body.String())

	actualApp, err := application.LoadByName(context.TODO(), api.mustDB(), proj.Key, app.Name, application.LoadOptions.WithClearDeploymentStrategies)
	require.NoError(t, err)
	assert.Equal(t, "my-secret-token-2", actualApp.DeploymentStrategies[pfname]["token"].Value)
	assert.Equal(t, "my-url-2", actualApp.DeploymentStrategies[pfname]["url"].Value)
}