### Question:
ControllerExecution { public void selectBB(BuildingBlockExecution execution) { try { String controllerActor = execution.getVariable(CONTROLLER_ACTOR); String action = Optional.of((String) execution.getVariable(ACTION)).get(); String scope = Optional.of((String) execution.getVariable(SCOPE)).get(); BBNameSelectionReference bbNameSelectionReference = catalogDbClient.getBBNameSelectionReference(controllerActor, scope, action); String bbName = bbNameSelectionReference.getBbName(); execution.setVariable(BBNAME, bbName); logger.debug(" Executing {} BPMN", bbName); } catch (Exception ex) { logger.error("An exception occurred while getting bbname from catalogdb ", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } }  void setControllerActorScopeAction(BuildingBlockExecution execution); void selectBB(BuildingBlockExecution execution);  }### Answer:
@Test public void testSelectBB() throws Exception { BBNameSelectionReference bbNameSelectionReference = new BBNameSelectionReference(); bbNameSelectionReference.setBbName(TEST_BBNAME); bbNameSelectionReference.setAction(TEST_ACTION); bbNameSelectionReference.setControllerActor(TEST_CONTROLLER_ACTOR); bbNameSelectionReference.setScope(TEST_SCOPE); doReturn(bbNameSelectionReference).when(catalogDbClient).getBBNameSelectionReference(TEST_CONTROLLER_ACTOR, TEST_SCOPE, TEST_ACTION); execution.setVariable("actor", TEST_CONTROLLER_ACTOR); execution.setVariable("scope", TEST_SCOPE); execution.setVariable("action", TEST_ACTION); controllerExecution.selectBB(execution); assertEquals(TEST_BBNAME, execution.getVariable("bbName")); }