Assert.assertEquals(GraphConstrant.ERROR, (int)state.getKey());
}
@Test
public void testBuildEdgeStateByProjectConfig(){
Dependency index = new Dependency();
String domain = "UserWeb";
String service = "UserService";
index.setType("PigeonCall");
index.setTarget(service);
index.setAvg(9.0);
index.setErrorCount(9);
index.setSum(1000.0);
index.setTotalCount(100);
Pair<Integer, String> state = m_manager.buildEdgeState(domain, index);
Assert.assertEquals(GraphConstrant.OK, (int)state.getKey());
index.setAvg(10.0);
state = m_manager.buildEdgeState(domain, index);
Assert.assertEquals(GraphConstrant.WARN, (int)state.getKey());
index.setAvg(20.0);
state = m_manager.buildEdgeState(domain, index);
Assert.assertEquals(GraphConstrant.ERROR, (int)state.getKey());
index.setAvg(9.0);
index.setErrorCount(10);
state = m_manager.buildEdgeState(domain, index);
Assert.assertEquals(GraphConstrant.WARN, (int)state.getKey());
index.setErrorCount(20);
state = m_manager.buildEdgeState(domain, index);
Assert.assertEquals(GraphConstrant.ERROR, (int)state.getKey());
}