Skip to content

Commit ba5f3c3

Browse files
JesseLovelacechingor13
authored andcommitted
---
yaml --- r: 31951 b: refs/heads/autosynth-datastore c: fff25ba h: refs/heads/master i: 31949: 26a96fc 31947: e1025c8 31943: e7d9640 31935: aa24666
1 parent 038e5a7 commit ba5f3c3

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ refs/heads/autosynth-bigquerystorage: a345f72d7a6358e9fea9dcdae94ec85a27da3088
127127
refs/heads/autosynth-bigtable: 2a6af7e2959fd79c99b8ca5d773f29a6434b546d
128128
refs/heads/autosynth-bigtable-admin: 6379a2bc712f2736c83de0e009b4d26da4fa82ca
129129
refs/heads/autosynth-containeranalysis: 18d210f81f17cf74864d0db2c29e834302f74f2a
130-
refs/heads/autosynth-datastore: 720d90171cd515c21a21f9f8f17d638ff67ec09c
130+
refs/heads/autosynth-datastore: fff25ba885353dd4c9499d9084e4463291c72c9a
131131
refs/heads/autosynth-dialogflow: 841930a680ebe370c9fc6ae824465f6bc51a5a46
132132
refs/heads/autosynth-errorreporting: 3f176c20b55dfaaa8fc32f28d82b31784b93e636
133133
refs/heads/autosynth-firestore: 983c75e4fb1076502c8cac73ef0538bdb10884f3

branches/autosynth-datastore/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Identity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public String strValue() {
255255
* policy identities to {@code Identity} objects.
256256
*/
257257
public static Identity valueOf(String identityStr) {
258-
String[] info = identityStr.split(":");
258+
String[] info = identityStr.split(":", 2);
259259
Type type = Type.valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, info[0]));
260260
if (info.length == 1) {
261261
return new Identity(type, null);

branches/autosynth-datastore/google-cloud-clients/google-cloud-core/src/test/java/com/google/cloud/IdentityTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,18 @@ public void testValueOfEmpty() {
141141
Identity.valueOf("");
142142
}
143143

144-
@Test(expected = IllegalArgumentException.class)
145-
public void testValueOfThreePart() {
146-
Identity.valueOf("a:b:c");
147-
}
148-
149144
@Test
150145
public void testUnrecognizedToString() {
151146
assertEquals("a:b", Identity.valueOf("a:b").strValue());
152147
}
153148

149+
@Test
150+
public void testValueOfThreePart() {
151+
Identity identity = Identity.valueOf("a:b:c");
152+
assertEquals("A", identity.getType().name());
153+
assertEquals("b:c", identity.getValue());
154+
}
155+
154156
private void compareIdentities(Identity expected, Identity actual) {
155157
assertEquals(expected, actual);
156158
assertEquals(expected.getType(), actual.getType());

0 commit comments

Comments
 (0)