use of com.quorum.tessera.config.AppType in project tessera by ConsenSys.
the class PrometheusProtocolFormatterTest method noArgResourceResponseCorrectlyFormatted.
@Test
public void noArgResourceResponseCorrectlyFormatted() {
mockMetrics.add(new MBeanResourceMetric("GET->upCheck()#a10a4f8d", "AverageTime[ms]_total", "100"));
AppType type = AppType.P2P;
String expectedResponse = "tessera_P2P_GET_upCheck_AverageTime_ms 100\n";
assertThat(protocolFormatter.format(mockMetrics, type)).isEqualTo(expectedResponse);
}
use of com.quorum.tessera.config.AppType in project tessera by ConsenSys.
the class PrometheusProtocolFormatterTest method noMetricsToFormatIsHandled.
@Test
public void noMetricsToFormatIsHandled() {
AppType type = AppType.P2P;
assertThat(protocolFormatter.format(mockMetrics, type)).isEmpty();
}
use of com.quorum.tessera.config.AppType in project tessera by ConsenSys.
the class ServerConfigsValidatorTest method onSetUp.
@Before
public void onSetUp() {
cvc = mock(ConstraintValidatorContext.class);
for (AppType appType : AppType.values()) {
ServerConfig serverConfig = new ServerConfig();
serverConfig.setApp(appType);
serverConfig.setServerAddress("localhost:123");
serverConfig.setCommunicationType(CommunicationType.REST);
serverConfig.setSslConfig(null);
serverConfig.setInfluxConfig(null);
serverConfig.setBindingAddress(null);
serverConfigsMap.put(appType, serverConfig);
}
validator = new ServerConfigsValidator();
when(cvc.buildConstraintViolationWithTemplate(anyString())).thenReturn(mock(ConstraintValidatorContext.ConstraintViolationBuilder.class));
}
Aggregations