Search in sources :

Example 6 with ManagedResourceStatus

use of com.redhat.service.smartevents.infra.models.dto.ManagedResourceStatus in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.

the class MetricsServiceImplTest method onOperationStart_forBridge.

@ParameterizedTest
@EnumSource(MetricsOperation.class)
public void onOperationStart_forBridge(MetricsOperation metricsOperation) {
    Bridge bridge = Fixtures.createBridge();
    ManagedResourceStatus status = metricsOperation == MetricsOperation.DELETE ? ManagedResourceStatus.DEPROVISION : ManagedResourceStatus.ACCEPTED;
    bridge.setStatus(status);
    metricsService.onOperationStart(bridge, metricsOperation);
    List<Tag> expectedTags = createdExpectedTags(bridge, metricsOperation);
    assertThat(meterRegistry.counter(operationTotalCountMetricName, expectedTags).count()).isEqualTo(1.0);
}
Also used : ManagedResourceStatus(com.redhat.service.smartevents.infra.models.dto.ManagedResourceStatus) Tag(io.micrometer.core.instrument.Tag) Bridge(com.redhat.service.smartevents.manager.models.Bridge) EnumSource(org.junit.jupiter.params.provider.EnumSource) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

ManagedResourceStatus (com.redhat.service.smartevents.infra.models.dto.ManagedResourceStatus)6 Bridge (com.redhat.service.smartevents.manager.models.Bridge)5 Tag (io.micrometer.core.instrument.Tag)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 EnumSource (org.junit.jupiter.params.provider.EnumSource)4 Processor (com.redhat.service.smartevents.manager.models.Processor)3 Parameters (io.quarkus.panache.common.Parameters)2 ListResult (com.redhat.service.smartevents.infra.models.ListResult)1 ProcessorType (com.redhat.service.smartevents.infra.models.processors.ProcessorType)1