@Override
    public StateMachineInstance getStateMachineInstanceByBusinessKey(String businessKey, String tenantId) {
        if (StringUtils.isEmpty(tenantId)) {
            tenantId = defaultTenantId;
        }
        StateMachineInstance stateMachineInstance = selectOne(
                stateLogStoreSqls.getGetStateMachineInstanceByBusinessKeySql(dbType), RESULT_SET_TO_STATE_MACHINE_INSTANCE,
                businessKey, tenantId);
        if (stateMachineInstance == null) {
            return null;
        }
        List<StateInstance> stateInstanceList = queryStateInstanceListByMachineInstanceId(stateMachineInstance.getId());
        for (StateInstance stateInstance : stateInstanceList) {
            stateMachineInstance.putStateInstance(stateInstance.getId(), stateInstance);
        }
        deserializeParamsAndException(stateMachineInstance);

        return stateMachineInstance;
    }
@Test
    public void testGetStateMachineInstanceByBusinessKey() {
        StateMachineInstanceImpl stateMachineInstance = new StateMachineInstanceImpl();
        stateMachineInstance.setStateMap(new HashMap<>());
        stateMachineInstance.setStateList(new ArrayList<>());
        Mockito.doReturn(stateMachineInstance).when(dbAndReportTcStateLogStore).selectOne(any(), any(), any(), any());
        dbAndReportTcStateLogStore.getStateMachineInstanceByBusinessKey("test", "test");
    }