2222import static org .junit .Assert .assertThrows ;
2323import static org .junit .Assert .assertTrue ;
2424
25+ import com .google .api .gax .longrunning .OperationFuture ;
2526import com .google .api .gax .rpc .NotFoundException ;
2627import com .google .cloud .resourcemanager .v3 .CreateTagKeyMetadata ;
2728import com .google .cloud .resourcemanager .v3 .CreateTagKeyRequest ;
3132import com .google .cloud .resourcemanager .v3 .DeleteTagKeyRequest ;
3233import com .google .cloud .resourcemanager .v3 .DeleteTagValueMetadata ;
3334import com .google .cloud .resourcemanager .v3 .DeleteTagValueRequest ;
34- import com .google .api .gax .longrunning .OperationFuture ;
3535import com .google .cloud .resourcemanager .v3 .TagKey ;
3636import com .google .cloud .resourcemanager .v3 .TagKeysClient ;
3737import com .google .cloud .resourcemanager .v3 .TagValue ;
4141import com .google .cloud .secretmanager .v1 .DeleteSecretRequest ;
4242import com .google .cloud .secretmanager .v1 .DisableSecretVersionRequest ;
4343import com .google .cloud .secretmanager .v1 .LocationName ;
44+ import com .google .cloud .secretmanager .v1 .ProjectName ;
4445import com .google .cloud .secretmanager .v1 .Secret ;
4546import com .google .cloud .secretmanager .v1 .SecretManagerServiceClient ;
4647import com .google .cloud .secretmanager .v1 .SecretManagerServiceClient .ListSecretVersionsPage ;
4950import com .google .cloud .secretmanager .v1 .SecretManagerServiceClient .ListSecretsPagedResponse ;
5051import com .google .cloud .secretmanager .v1 .SecretManagerServiceSettings ;
5152import com .google .cloud .secretmanager .v1 .SecretName ;
52- import com .google .cloud .secretmanager .v1 .ProjectName ;
5353import com .google .cloud .secretmanager .v1 .SecretPayload ;
5454import com .google .cloud .secretmanager .v1 .SecretVersion ;
5555import com .google .cloud .secretmanager .v1 .SecretVersion .State ;
5959import com .google .iam .v1 .Policy ;
6060import com .google .protobuf .ByteString ;
6161import java .io .ByteArrayOutputStream ;
62- import java .lang .Exception ;
6362import java .io .IOException ;
6463import java .io .PrintStream ;
64+ import java .lang .Exception ;
6565import java .util .Map ;
6666import java .util .Random ;
6767import org .junit .After ;
@@ -134,7 +134,7 @@ public static void beforeAll() throws Exception {
134134 TEST_REGIONAL_SECRET_WITH_LABEL_TO_CREATE_NAME =
135135 SecretName .ofProjectLocationSecretName (PROJECT_ID , LOCATION_ID , randomSecretId ());
136136 TEST_REGIONAL_SECRET_WITH_TAGS_TO_CREATE_NAME =
137- SecretName .ofProjectLocationSecretName (PROJECT_ID , LOCATION_ID , randomSecretId ());
137+ SecretName .ofProjectLocationSecretName (PROJECT_ID , LOCATION_ID , randomSecretId ());
138138 TEST_REGIONAL_SECRET_VERSION = addRegionalSecretVersion (TEST_REGIONAL_SECRET_WITH_VERSIONS );
139139 TEST_REGIONAL_SECRET_VERSION_TO_DESTROY =
140140 addRegionalSecretVersion (TEST_REGIONAL_SECRET_WITH_VERSIONS );
@@ -186,10 +186,10 @@ private static String randomSecretId() {
186186 return "test-drz-" + random .nextLong ();
187187 }
188188
189- private static void createTags () throws Exception {
189+ private static void createTags () throws Exception {
190190 try (TagKeysClient tagKeysClient = TagKeysClient .create ()) {
191- ProjectName parent = ProjectName .of (PROJECT_ID );
192- Random random = new Random ();
191+ ProjectName parent = ProjectName .of (PROJECT_ID );
192+ Random random = new Random ();
193193 CreateTagKeyRequest request =
194194 CreateTagKeyRequest .newBuilder ()
195195 .setTagKey (
@@ -205,7 +205,7 @@ private static void createTags() throws Exception{
205205 }
206206
207207 try (TagValuesClient tagValuesClient = TagValuesClient .create ()) {
208- Random random = new Random ();
208+ Random random = new Random ();
209209 CreateTagValueRequest request =
210210 CreateTagValueRequest .newBuilder ()
211211 .setTagValue (
@@ -222,9 +222,9 @@ private static void createTags() throws Exception{
222222
223223 }
224224
225- private static void deleteTags () throws Exception {
226- Thread .sleep (60000 );
227- try (TagValuesClient tagValuesClient = TagValuesClient .create ()) {
225+ private static void deleteTags () throws Exception {
226+ Thread .sleep (60000 );
227+ try (TagValuesClient tagValuesClient = TagValuesClient .create ()) {
228228 DeleteTagValueRequest request =
229229 DeleteTagValueRequest .newBuilder ()
230230 .setName (TAG_VALUE .getName ())
@@ -341,10 +341,10 @@ public void testCreateRegionalSecretWithTags() throws IOException {
341341 SecretName name = TEST_REGIONAL_SECRET_WITH_TAGS_TO_CREATE_NAME ;
342342 Secret secret = CreateRegionalSecretWithTags .createRegionalSecretWithTags (
343343 name .getProject (),
344- name .getLocation (),
345- name .getSecret (),
346- TAG_KEY .getName (),
347- TAG_VALUE .getName ()
344+ name .getLocation (),
345+ name .getSecret (),
346+ TAG_KEY .getName (),
347+ TAG_VALUE .getName ()
348348 );
349349
350350 assertThat (stdOut .toString ()).contains ("Created secret with Tags" );
0 commit comments