Skip to content

Commit ba78057

Browse files
JesseLovelacechingor13
authored andcommitted
---
yaml --- r: 34303 b: refs/heads/autosynth-speech c: fff25ba h: refs/heads/master i: 34301: 83b253d 34299: 3902be8 34295: e27e17e 34287: 4f7fd8f 34271: 1322ac8 34239: 3f1cb6c 34175: 0f6c9c5 34047: b14ed0c 33791: 2d0baed
1 parent cee018f commit ba78057

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
@@ -138,7 +138,7 @@ refs/heads/autosynth-os-login: 49028d40ac477fca5f948cc5a3ce7422729fdb67
138138
refs/heads/autosynth-redis: 2b698ebe7faaa0b93246576a88941682e0888e57
139139
refs/heads/autosynth-scheduler: a3de6480746d1cd586ca8b9d75c55a636f371539
140140
refs/heads/autosynth-spanner: d963fe4368e79cf6abae5d511785e8ced8ac57f4
141-
refs/heads/autosynth-speech: 720d90171cd515c21a21f9f8f17d638ff67ec09c
141+
refs/heads/autosynth-speech: fff25ba885353dd4c9499d9084e4463291c72c9a
142142
refs/heads/autosynth-tasks: eb03eeab747e925175890db923945384d89b273a
143143
refs/heads/autosynth-texttospeech: 2c442fe0b7f089fbab266edfe4dd83c532e82dd0
144144
refs/heads/autosynth-trace: c94eef6e4d9c6fd24888216e28ca7271959c1cf0

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