Skip to content

Commit f455ac5

Browse files
JesseLovelacechingor13
authored andcommitted
---
yaml --- r: 33519 b: refs/heads/autosynth-os-login c: fff25ba h: refs/heads/master i: 33517: c6329e3 33515: 1e5bd29 33511: aee12dd 33503: 779d065
1 parent f63d8b2 commit f455ac5

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
@@ -134,7 +134,7 @@ refs/heads/autosynth-firestore: e79eeb26930dfae4439424ad2fda5874eeca54c8
134134
refs/heads/autosynth-iot: 044be280805a59e06d09658688c9ee474a9815ad
135135
refs/heads/autosynth-kms: d31449d6621a50fb16a4bef4f30f0f3051d27d7c
136136
refs/heads/autosynth-language: 6130869312f99a1e7d3aa0485759172a23333cc5
137-
refs/heads/autosynth-os-login: 720d90171cd515c21a21f9f8f17d638ff67ec09c
137+
refs/heads/autosynth-os-login: fff25ba885353dd4c9499d9084e4463291c72c9a
138138
refs/heads/autosynth-redis: 6bedce4d7c7c6ca6a22e83ad1780e08fdc565a9e
139139
refs/heads/autosynth-scheduler: 57f9fdb1e7de30c85f4ec7198931a07f50603e55
140140
refs/heads/autosynth-spanner: de02ca32edea133b68b51052e325359a3704b5d2

branches/autosynth-os-login/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-os-login/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)