@@ -392,31 +392,30 @@ public void invokeHandler_InProgress_returnsInProgress(final String requestDataP
392392 verifyInitialiseRuntime ();
393393
394394 // all metrics should be published, once for a single invocation
395- verify (providerMetricsPublisher , times ( 1 ) ).publishInvocationMetric (any (Instant .class ), eq (action ));
396- verify (providerMetricsPublisher , times ( 1 ) ).publishDurationMetric (any (Instant .class ), eq (action ), anyLong ());
395+ verify (providerMetricsPublisher ).publishInvocationMetric (any (Instant .class ), eq (action ));
396+ verify (providerMetricsPublisher ).publishDurationMetric (any (Instant .class ), eq (action ), anyLong ());
397397
398398 // verify that model validation occurred for CREATE/UPDATE/DELETE
399399 if (action == Action .CREATE || action == Action .UPDATE || action == Action .DELETE ) {
400- verify (validator , times ( 1 ) ).validateObject (any (JSONObject .class ), any (JSONObject .class ));
400+ verify (validator ).validateObject (any (JSONObject .class ), any (JSONObject .class ));
401401
402402 // verify output response
403403 verifyHandlerResponse (out , ProgressEvent .<TestModel , TestContext >builder ().status (OperationStatus .IN_PROGRESS )
404404 .resourceModel (TestModel .builder ().property1 ("abc" ).property2 (123 ).build ()).build ());
405- verify (providerMetricsPublisher , atLeastOnce ()).publishExceptionByErrorCodeMetric (any (Instant .class ), eq (action ),
406- any (), eq (Boolean .FALSE ));
407- verify (providerMetricsPublisher ).publishExceptionCountMetric (any (Instant .class ), eq (action ), eq (Boolean .FALSE ));
408405 } else {
409406 verifyHandlerResponse (out ,
410407 ProgressEvent .<TestModel , TestContext >builder ().status (OperationStatus .FAILED )
411408 .errorCode (HandlerErrorCode .InternalFailure ).message ("READ and LIST handlers must return synchronously." )
412409 .build ());
413410 verify (providerMetricsPublisher ).publishExceptionMetric (any (Instant .class ), eq (action ),
414411 any (TerminalException .class ), eq (HandlerErrorCode .InternalFailure ));
415- verify (providerMetricsPublisher ).publishExceptionByErrorCodeMetric (any (Instant .class ), eq (action ),
416- eq (HandlerErrorCode .InternalFailure ), eq (Boolean .TRUE ));
417- verify (providerMetricsPublisher ).publishExceptionCountMetric (any (Instant .class ), eq (action ), eq (Boolean .TRUE ));
412+
418413 }
419414
415+ verify (providerMetricsPublisher , atLeastOnce ()).publishExceptionByErrorCodeMetric (any (Instant .class ), eq (action ),
416+ any (), any (Boolean .class ));
417+ verify (providerMetricsPublisher ).publishExceptionCountMetric (any (Instant .class ), any (), any (Boolean .class ));
418+
420419 // validation failure metric should not be published
421420 verifyNoMoreInteractions (providerMetricsPublisher );
422421
@@ -811,8 +810,8 @@ public void invokeHandler_metricPublisherThrowable_returnsFailureResponse() thro
811810 // verify initialiseRuntime was called and initialised dependencies
812811 verifyInitialiseRuntime ();
813812
814- verify (providerMetricsPublisher ) .publishExceptionByErrorCodeMetric (any (Instant . class ), any ( Action .class ),
815- any (HandlerErrorCode .class ), any (Boolean .class ));
813+ verify (providerMetricsPublisher , atLeastOnce ()) .publishExceptionByErrorCodeMetric (any (Instant .class ),
814+ any (Action . class ), any ( HandlerErrorCode .class ), any (Boolean .class ));
816815
817816 verify (providerMetricsPublisher ).publishExceptionCountMetric (any (Instant .class ), any (Action .class ),
818817 any (Boolean .class ));
0 commit comments