forked from matomo-org/matomo-java-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPiwikJsonArrayTest.java
More file actions
71 lines (58 loc) · 1.47 KB
/
PiwikJsonArrayTest.java
File metadata and controls
71 lines (58 loc) · 1.47 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* Piwik Java Tracker
*
* @link https://github.com/piwik/piwik-java-tracker
* @license https://github.com/piwik/piwik-java-tracker/blob/master/LICENSE BSD-3 Clause
*/
package org.piwik.java.tracking;
import javax.json.JsonValue;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.mockito.Mockito.mock;
/**
*
* @author brettcsorba
*/
public class PiwikJsonArrayTest{
PiwikJsonArray array;
public PiwikJsonArrayTest(){
}
@BeforeClass
public static void setUpClass(){
}
@AfterClass
public static void tearDownClass(){
}
@Before
public void setUp(){
array = new PiwikJsonArray();
}
@After
public void tearDown(){
}
/**
* Test of get method, of class PiwikJsonArray.
*/
@Test
public void testAddGetSet(){
JsonValue value = mock(JsonValue.class);
JsonValue value2 = mock(JsonValue.class);
array.add(value);
assertEquals(value, array.get(0));
array.set(0, value2);
assertEquals(value2, array.get(0));
}
/**
* Test of toString method, of class PiwikJsonArray.
*/
@Test
public void testToString(){
array.add(JsonValue.TRUE);
array.add(JsonValue.FALSE);
assertEquals("[true,false]", array.toString());
}
}