Skip to content

Commit

Permalink
Refactor MetricsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
pivovarit committed Jan 19, 2017
1 parent b68337b commit 71c2982
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions metrics/src/test/java/com/baeldung/metrics/core/MetricsTest.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package com.baeldung.metrics.core;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import com.codahale.metrics.*;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

import org.junit.Test;

import com.codahale.metrics.*;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;

public class MetricsTest {
@Test
Expand Down Expand Up @@ -139,7 +138,7 @@ public void whenUseTimer_thenCorrectTimerContexts() throws InterruptedException

long elapsed1 = context1.stop();

assertEquals(5000000000L, elapsed1, 1000000);
assertEquals(5000000000L, elapsed1, 10000000);
assertThat(timer.getCount(), equalTo(1L));
assertEquals(0.2, timer.getMeanRate(), 0.1);

Expand Down

0 comments on commit 71c2982

Please sign in to comment.