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
2 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import com .google .api .core .BetaApi ;
20
20
import com .google .auto .value .AutoValue ;
21
+ import javax .annotation .Nullable ;
21
22
22
23
/**
23
24
* Class for Identity and Access Management (IAM) policies. IAM policies are used to specify access
32
33
@ AutoValue
33
34
public abstract class Condition {
34
35
/** Get IAM Policy Binding Condition Title */
36
+ @ Nullable
35
37
public abstract String getTitle ();
36
38
37
39
/** Get IAM Policy Binding Condition Description */
40
+ @ Nullable
38
41
public abstract String getDescription ();
39
42
40
43
/** Get IAM Policy Binding Condition Expression */
@@ -51,10 +54,10 @@ public static Builder newBuilder() {
51
54
@ AutoValue .Builder
52
55
public abstract static class Builder {
53
56
/** Set IAM Policy Binding Condition Title */
54
- public abstract Builder setTitle (String title );
57
+ public abstract Builder setTitle (@ Nullable String title );
55
58
56
59
/** Set IAM Policy Binding Condition Description */
57
- public abstract Builder setDescription (String description );
60
+ public abstract Builder setDescription (@ Nullable String description );
58
61
59
62
/** Set IAM Policy Binding Condition Expression */
60
63
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