### Question:
ExecuteBuildingBlockRainyDay { public void setRetryTimer(DelegateExecution execution) { try { int retryDurationMult = Integer.parseInt(this.environment.getProperty(retryDurationPath)); int retryCount = (int) execution.getVariable("retryCount"); int retryTimeToWait = (int) Math.pow(retryDurationMult, retryCount) * 10; String RetryDuration = "PT" + retryTimeToWait + "S"; execution.setVariable("RetryDuration", RetryDuration); } catch (Exception e) { logger.error("Exception occurred", e); throw new BpmnError("Unknown error incrementing retry counter"); } }  void setRetryTimer(DelegateExecution execution); void queryRainyDayTable(DelegateExecution execution, boolean primaryPolicy); void setHandlingStatusSuccess(DelegateExecution execution); void updateExtSystemErrorSource(DelegateExecution execution); static final String HANDLING_CODE; static final String ROLLBACK_TARGET_STATE; static final String RAINY_DAY_SERVICE_TYPE; static final String RAINY_DAY_VNF_TYPE; static final String RAINY_DAY_VNF_NAME; }### Answer:
@Test public void setRetryTimerTest() throws Exception { delegateExecution.setVariable("retryCount", 2); executeBuildingBlockRainyDay.setRetryTimer(delegateExecution); assertEquals("PT40S", delegateExecution.getVariable("RetryDuration")); }
@Test public void setRetryTimerExceptionTest() { expectedException.expect(BpmnError.class); DelegateExecution execution = mock(DelegateExecution.class); when(execution.getVariable(eq("retryCount"))).thenThrow(BpmnError.class); executeBuildingBlockRainyDay.setRetryTimer(execution); }