### Question:
AuditTasks { public void setupAuditVariable(BuildingBlockExecution execution) { try { execution.setVariable("auditInventory", createAuditInventory(execution)); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void isAuditNeeded(BuildingBlockExecution execution); void isDeleteAuditNeeded(BuildingBlockExecution execution); void setupAuditVariable(BuildingBlockExecution execution);  }### Answer:
@Test public void setupAuditVariableTest() throws Exception { AuditInventory expectedAuditInventory = new AuditInventory(); expectedAuditInventory.setCloudOwner("testCloudOwner"); expectedAuditInventory.setCloudRegion("testLcpCloudRegionId"); expectedAuditInventory.setHeatStackName("testVfModuleName1"); expectedAuditInventory.setVfModuleId("testVfModuleId1"); expectedAuditInventory.setTenantId("testTenantId"); expectedAuditInventory.setGenericVnfId("testVnfId1"); expectedAuditInventory.setMsoRequestId("fb06f44c-c797-4f38-9b17-b4b975344600"); auditTasks.setupAuditVariable(execution); }
@Test public void setupAuditVariable_shouldThrowWorkflowExceptionIfFails() { execution.setVariable("gBBInput", null); auditTasks.setupAuditVariable(execution); verify(exceptionUtil, times(1)).buildAndThrowWorkflowException(eq(execution), eq(7000), any(Exception.class)); }