File tree Expand file tree Collapse file tree 2 files changed +45
-2
lines changed
java-core/google-cloud-core/src
main/java/com/google/cloud
test/java/com/google/cloud Expand file tree Collapse file tree 2 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 1818
1919import com .google .api .core .BetaApi ;
2020import com .google .auto .value .AutoValue ;
21+ import javax .annotation .Nullable ;
2122
2223/**
2324 * Class for Identity and Access Management (IAM) policies. IAM policies are used to specify access
3233@ AutoValue
3334public abstract class Condition {
3435 /** Get IAM Policy Binding Condition Title */
36+ @ Nullable
3537 public abstract String getTitle ();
3638
3739 /** Get IAM Policy Binding Condition Description */
40+ @ Nullable
3841 public abstract String getDescription ();
3942
4043 /** Get IAM Policy Binding Condition Expression */
@@ -51,10 +54,10 @@ public static Builder newBuilder() {
5154 @ AutoValue .Builder
5255 public abstract static class Builder {
5356 /** Set IAM Policy Binding Condition Title */
54- public abstract Builder setTitle (String title );
57+ public abstract Builder setTitle (@ Nullable String title );
5558
5659 /** Set IAM Policy Binding Condition Description */
57- public abstract Builder setDescription (String description );
60+ public abstract Builder setDescription (@ Nullable String description );
5861
5962 /** Set IAM Policy Binding Condition Expression */
6063 public abstract Builder setExpression (String expression );
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 Google LLC
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .google .cloud ;
18+
19+ import static com .google .common .truth .Truth .assertThat ;
20+
21+ import org .junit .Test ;
22+
23+ public final class ConditionTest {
24+
25+ @ Test
26+ public void title_nullable () {
27+ Condition condition =
28+ Condition .newBuilder ().setTitle (null ).setDescription ("desc" ).setExpression ("expr" ).build ();
29+
30+ assertThat (condition .getTitle ()).isNull ();
31+ }
32+
33+ @ Test
34+ public void description_nullable () {
35+ Condition condition =
36+ Condition .newBuilder ().setTitle ("title" ).setDescription (null ).setExpression ("expr" ).build ();
37+
38+ assertThat (condition .getDescription ()).isNull ();
39+ }
40+ }
You can’t perform that action at this time.
0 commit comments