Skip to content

Commit 82e2b6a

Browse files
authored
Merge pull request #238 from cloudinary/fix/fix_failing_test
Fix error message returned from the server
2 parents 97a54d2 + 2f29d8e commit 82e2b6a

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

cloudinary-core/src/test/java/com/cloudinary/transformation/LayerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public void testLayerOptions() {
6464
Object tests[] = {
6565
new Layer().publicId("logo"),
6666
"logo",
67+
new Layer().publicId("logo__111"),
68+
"logo__111",
6769
new Layer().publicId("folder/logo"),
6870
"folder:logo",
6971
new Layer().publicId("logo").type("private"),

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractAccountApiTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ public void testDeleteSubAccount() throws Exception {
151151
@Test
152152
public void testGetUser() throws Exception {
153153
ApiResponse user = createUser();
154-
ApiResponse result = account.user(user.get("id").toString(), null);
154+
String id = user.get("id").toString();
155+
ApiResponse result = account.user(id, null);
155156
assertNotNull(result);
156157
}
157158

@@ -183,9 +184,9 @@ public void testCreateUser() throws Exception {
183184
@Test
184185
public void testUpdateUser() throws Exception {
185186
ApiResponse user = createUser(Account.Role.ADMIN);
186-
187+
String id = user.get("id").toString();
187188
String newName = randomLetters();
188-
ApiResponse result = account.updateUser(user.get("id").toString(), newName, null, null, null, null);
189+
ApiResponse result = account.updateUser(id, newName, null, null, null, null);
189190
assertNotNull(result);
190191
assertEquals(result.get("name"), newName);
191192
}
@@ -228,7 +229,8 @@ public void testDeleteUserGroup() throws Exception {
228229
public void testAddUserToUserGroup() throws Exception {
229230
ApiResponse user = createUser();
230231
ApiResponse group = createGroup();
231-
ApiResponse result = account.addUserToGroup(group.get("id").toString(), user.get("id").toString(), null);
232+
String userId = user.get("id").toString();
233+
ApiResponse result = account.addUserToGroup(group.get("id").toString(), userId, null);
232234
assertNotNull(result);
233235
}
234236

@@ -280,7 +282,6 @@ private ApiResponse createGroup() throws Exception {
280282
ApiResponse userGroup = account.createUserGroup(name);
281283
createdGroupIds.add(userGroup.get("id").toString());
282284
return userGroup;
283-
284285
}
285286

286287
private ApiResponse createUser(Account.Role role) throws Exception {
@@ -313,7 +314,6 @@ private static String randomLetters() {
313314
for (int i = 0; i < 10; i++) {
314315
sb.append((char) ('a' + rand.nextInt('z' - 'a' + 1)));
315316
}
316-
317317
return sb.toString();
318318
}
319319
}

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractStructuredMetadataTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public void testExplicitWithMetadata() throws Exception {
204204
message = e.getMessage();
205205
}
206206

207-
assertTrue(message.contains("Value 12 is invalid for field") );
207+
assertTrue(message.contains("is not valid for field") );
208208
}
209209

210210
@Test

0 commit comments

Comments
 (0)