SIGN IN SIGN UP

Welcome to the AWS Code Examples Repository. This repo contains code examples used in the AWS documentation, AWS SDK Developer Guides, and more. For more information, see the Readme.md file below.

0 0 7 Java
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
/*
* Test types are indicated by the test label ending.
*
* _1_ Requires credentials, permissions, and AWS resources.
* _2_ Requires credentials and permissions.
* _3_ Does not require credentials.
*
*/
#include <gtest/gtest.h>
#include <fstream>
#include "../s3_examples.h"
#include "S3_GTests.h"
static const int BUCKETS_NEEDED = 1;
namespace AwsDocTest {
// NOLINTNEXTLINE(readability-named-parameter)
TEST_F(S3_GTests, put_object_buffer_2_) {
std::vector<Aws::String> bucketNames = GetCachedS3Buckets(BUCKETS_NEEDED);
ASSERT_GE(bucketNames.size(), BUCKETS_NEEDED) << "Failed to meet precondition" << std::endl;
Aws::String objectKey = "unit_test_text.txt";
bool result = AwsDoc::S3::putObjectBuffer(bucketNames[0], objectKey, "some text", *s_clientConfig);
EXPECT_TRUE(result);
DeleteObjectInBucket(bucketNames[0], objectKey);
}
} // namespace AwsDocTest