func (s *cmdIntegrationSuite) TestSyncS2SWithMissingDestination(c *chk.C) {
	bsu := getBSU()
	srcContainerURL, srcContainerName := createNewContainer(c, bsu)
	dstContainerURL, dstContainerName := createNewContainer(c, bsu)
	defer deleteContainer(c, srcContainerURL)

	// delete the destination container to simulate non-existing destination, or recently removed destination
	deleteContainer(c, dstContainerURL)

	// set up the container with numerous blobs
	blobList := scenarioHelper{}.generateCommonRemoteScenarioForBlob(c, srcContainerURL, "")
	c.Assert(len(blobList), chk.Not(chk.Equals), 0)

	// set up interceptor
	mockedRPC := interceptor{}
	Rpc = mockedRPC.intercept
	mockedRPC.init()

	// construct the raw input to simulate user input
	srcContainerURLWithSAS := scenarioHelper{}.getRawContainerURLWithSAS(c, srcContainerName)
	dstContainerURLWithSAS := scenarioHelper{}.getRawContainerURLWithSAS(c, dstContainerName)
	raw := getDefaultSyncRawInput(srcContainerURLWithSAS.String(), dstContainerURLWithSAS.String())

	// verify error is thrown
	runSyncAndVerify(c, raw, func(err error) {
		// error should not be nil, but the app should not crash either
		c.Assert(err, chk.NotNil)

		// validate that the right number of transfers were scheduled
		c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
	})
}
// validate the bug fix for this scenario
validate the bug fix for this scenario
// validate the bug fix for this scenario
func (s *cmdIntegrationSuite) TestSyncS2SWithMissingDestination(c *chk.C) {
	bsu := getBSU()
	srcContainerURL, srcContainerName := createNewContainer(c, bsu)
	dstContainerURL, dstContainerName := createNewContainer(c, bsu)
	defer deleteContainer(c, srcContainerURL)
	deleteContainer(c, dstContainerURL)
	blobList := scenarioHelper{}.generateCommonRemoteScenarioForBlob(c, srcContainerURL, "")
	c.Assert(len(blobList), chk.Not(chk.Equals), 0)
	mockedRPC := interceptor{}
	Rpc = mockedRPC.intercept
	mockedRPC.init()
	srcContainerURLWithSAS := scenarioHelper{}.getRawContainerURLWithSAS(c, srcContainerName)
	dstContainerURLWithSAS := scenarioHelper{}.getRawContainerURLWithSAS(c, dstContainerName)
	raw := getDefaultSyncRawInput(srcContainerURLWithSAS.String(), dstContainerURLWithSAS.String())
	runSyncAndVerify(c, raw, func(err error) {
		c.Assert(err, chk.NotNil)
		c.Assert(len(mockedRPC.transfers), chk.Equals, 0)
	})
}
func ( s * cmdIntegrationSuite ) TestSyncS2SWithMissingDestination ( c * chk . C ) { bsu := getBSU ( ) srcContainerURL , srcContainerName := createNewContainer ( c , bsu ) dstContainerURL , dstContainerName := createNewContainer ( c , bsu ) defer deleteContainer ( c , srcContainerURL ) deleteContainer ( c , dstContainerURL ) blobList := scenarioHelper { } . generateCommonRemoteScenarioForBlob ( c , srcContainerURL , " " ) c . Assert ( len ( blobList ) , chk . Not ( chk . Equals ) , 0 ) mockedRPC := interceptor { } Rpc = mockedRPC . intercept mockedRPC . init ( ) srcContainerURLWithSAS := scenarioHelper { } . getRawContainerURLWithSAS ( c , srcContainerName ) dstContainerURLWithSAS := scenarioHelper { } . getRawContainerURLWithSAS ( c , dstContainerName ) raw := getDefaultSyncRawInput ( srcContainerURLWithSAS . String ( ) , dstContainerURLWithSAS . String ( ) ) runSyncAndVerify ( c , raw , func ( err error ) { c . Assert ( err , chk . NotNil ) c . Assert ( len ( mockedRPC . transfers ) , chk . Equals , 0 ) } ) }
validate the bug fix for this scenario
validate the bug fix for this scenario
// delete the destination container to simulate non-existing destination, or recently removed destination // set up the container with numerous blobs // set up interceptor // construct the raw input to simulate user input // verify error is thrown // error should not be nil, but the app should not crash either // validate that the right number of transfers were scheduled