forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserTest.java
More file actions
30 lines (23 loc) · 1.09 KB
/
Copy pathUserTest.java
File metadata and controls
30 lines (23 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.gooddata.project;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.testng.annotations.Test;
import java.io.InputStream;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
public class UserTest {
@Test
public void testDeserialization() throws Exception {
final InputStream stream = getClass().getResourceAsStream("/project/project-user.json");
final User user = new ObjectMapper().readValue(stream, User.class);
assertThat(user, notNullValue());
assertThat(user.getEmail(), is("ateam+ads-testing@gooddata.com"));
assertThat(user.getFirstName(), is("ateam"));
assertThat(user.getUserRoles(), hasItem("/gdc/projects/PROJECT_ID/roles/ROLE1"));
assertThat(user.getPhoneNumber(), is("123456789"));
assertThat(user.getStatus(), is("ENABLED"));
assertThat(user.getLastName(), is("ads-testing"));
assertThat(user.getLogin(), is("ateam+ads-testing@gooddata.com"));
}
}