Refactor MetricsTest
This commit is contained in:
parent
b68337b329
commit
71c298276f
@ -1,16 +1,15 @@
|
|||||||
package com.baeldung.metrics.core;
|
package com.baeldung.metrics.core;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.equalTo;
|
import com.codahale.metrics.*;
|
||||||
import static org.junit.Assert.assertEquals;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.assertThat;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static org.hamcrest.CoreMatchers.equalTo;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
import com.codahale.metrics.*;
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
public class MetricsTest {
|
public class MetricsTest {
|
||||||
@Test
|
@Test
|
||||||
@ -139,7 +138,7 @@ public class MetricsTest {
|
|||||||
|
|
||||||
long elapsed1 = context1.stop();
|
long elapsed1 = context1.stop();
|
||||||
|
|
||||||
assertEquals(5000000000L, elapsed1, 1000000);
|
assertEquals(5000000000L, elapsed1, 10000000);
|
||||||
assertThat(timer.getCount(), equalTo(1L));
|
assertThat(timer.getCount(), equalTo(1L));
|
||||||
assertEquals(0.2, timer.getMeanRate(), 0.1);
|
assertEquals(0.2, timer.getMeanRate(), 0.1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user