forked from gooddata/gooddata-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFactTest.java
More file actions
31 lines (25 loc) · 1.06 KB
/
Copy pathFactTest.java
File metadata and controls
31 lines (25 loc) · 1.06 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
31
/*
* Copyright (C) 2007-2014, GoodData(R) Corporation. All rights reserved.
*/
package com.gooddata.md;
import org.codehaus.jackson.map.ObjectMapper;
import org.testng.annotations.Test;
import static com.gooddata.JsonMatchers.serializesToJson;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
public class FactTest {
@Test
public void testDeserialization() throws Exception {
final Fact fact = new ObjectMapper().readValue(getClass().getResourceAsStream("/md/fact.json"), Fact.class);
assertThat(fact, is(notNullValue()));
assertThat(fact.getExpressions(), is(notNullValue()));
assertThat(fact.getExpressions(), hasSize(1));
}
@Test
public void testSerialization() throws Exception {
final Fact fact = new Fact("Person Shoe Size", "/gdc/md/PROJECT_ID/obj/COL_ID", "col");
assertThat(fact, serializesToJson("/md/fact-input.json"));
}
}