/
QueryMetricTests.java
52 lines (41 loc) · 1.48 KB
/
QueryMetricTests.java
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
/*
* ****************************************************************************
* Cloud Foundry
* Copyright (c) [2009-2017] Pivotal Software, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except in compliance with the License.
*
* This product includes a number of subcomponents with
* separate copyright notices and license terms. Your use of these
* subcomponents is subject to the terms and conditions of the
* subcomponent's license, as noted in the LICENSE file.
* ****************************************************************************
*/
package org.cloudfoundry.identity.uaa.metrics;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class QueryMetricTests {
private QueryMetric metric;
@Before
public void setup() throws Exception {
metric = new QueryMetric("query", 1, 5, true);
}
@Test
public void getQuery() throws Exception {
assertEquals("query", metric.getQuery());
}
@Test
public void isSuccess() throws Exception {
assertEquals(true, metric.isIntolerable());
}
@Test
public void getRequestStartTime() throws Exception {
assertEquals(1, metric.getRequestStartTime());
}
@Test
public void getRequestCompleteTime() throws Exception {
assertEquals(6, metric.getRequestCompleteTime());
}
}