Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public void testLayerOptions() {
Object tests[] = {
new Layer().publicId("logo"),
"logo",
new Layer().publicId("logo__111"),
"logo__111",
new Layer().publicId("folder/logo"),
"folder:logo",
new Layer().publicId("logo").type("private"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ public void testDeleteSubAccount() throws Exception {
@Test
public void testGetUser() throws Exception {
ApiResponse user = createUser();
ApiResponse result = account.user(user.get("id").toString(), null);
String id = user.get("id").toString();
ApiResponse result = account.user(id, null);
assertNotNull(result);
}

Expand Down Expand Up @@ -183,9 +184,9 @@ public void testCreateUser() throws Exception {
@Test
public void testUpdateUser() throws Exception {
ApiResponse user = createUser(Account.Role.ADMIN);

String id = user.get("id").toString();
String newName = randomLetters();
ApiResponse result = account.updateUser(user.get("id").toString(), newName, null, null, null, null);
ApiResponse result = account.updateUser(id, newName, null, null, null, null);
assertNotNull(result);
assertEquals(result.get("name"), newName);
}
Expand Down Expand Up @@ -228,7 +229,8 @@ public void testDeleteUserGroup() throws Exception {
public void testAddUserToUserGroup() throws Exception {
ApiResponse user = createUser();
ApiResponse group = createGroup();
ApiResponse result = account.addUserToGroup(group.get("id").toString(), user.get("id").toString(), null);
String userId = user.get("id").toString();
ApiResponse result = account.addUserToGroup(group.get("id").toString(), userId, null);
assertNotNull(result);
}

Expand Down Expand Up @@ -280,7 +282,6 @@ private ApiResponse createGroup() throws Exception {
ApiResponse userGroup = account.createUserGroup(name);
createdGroupIds.add(userGroup.get("id").toString());
return userGroup;

}

private ApiResponse createUser(Account.Role role) throws Exception {
Expand Down Expand Up @@ -313,7 +314,6 @@ private static String randomLetters() {
for (int i = 0; i < 10; i++) {
sb.append((char) ('a' + rand.nextInt('z' - 'a' + 1)));
}

return sb.toString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public void testExplicitWithMetadata() throws Exception {
message = e.getMessage();
}

assertTrue(message.contains("Value 12 is invalid for field") );
assertTrue(message.contains("is not valid for field") );
}

@Test
Expand Down