2022-10-07 15:58:01 -04:00
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
2023-03-01 15:59:42 -05:00
/*
* 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.
*
*/
2022-10-07 15:58:01 -04:00
# include <gtest/gtest.h>
# include "iam_samples.h"
# include "iam_gtests.h"
2022-10-12 14:52:10 -04:00
namespace AwsDocTest {
2022-10-07 15:58:01 -04:00
// NOLINTNEXTLINE(readability-named-parameter)
2023-03-01 15:59:42 -05:00
TEST_F ( IAM_GTests , update_access_key_2_ ) {
2022-10-12 14:52:10 -04:00
auto key = getExistingKey ( ) ;
ASSERT_FALSE ( key . empty ( ) ) < < preconditionError ( ) < < std : : endl ;
auto userName = getUser ( ) ;
ASSERT_FALSE ( key . empty ( ) ) < < preconditionError ( ) < < std : : endl ;
auto result = AwsDoc : : IAM : : updateAccessKey ( userName , key ,
Aws : : IAM : : Model : : StatusType : : Inactive ,
* s_clientConfig ) ;
ASSERT_TRUE ( result ) ;
2022-10-07 15:58:01 -04:00
}
} // namespace AwsDocTest