### Question:
DefaultCore implements Core { @Override public String begin(String applicationId, String transactionServiceGroup, String name, int timeout) throws TransactionException { GlobalSession session = GlobalSession.createGlobalSession(applicationId, transactionServiceGroup, name, timeout); session.addSessionLifecycleListener(SessionHolder.getRootSessionManager()); session.begin(); eventBus.post(new GlobalTransactionEvent(session.getTransactionId(), GlobalTransactionEvent.ROLE_TC, session.getTransactionName(), session.getBeginTime(), null, session.getStatus())); return session.getXid(); } DefaultCore(RemotingServer remotingServer); AbstractCore getCore(BranchType branchType); void mockCore(BranchType branchType, AbstractCore core); @Override Long branchRegister(BranchType branchType, String resourceId, String clientId, String xid,
                               String applicationData, String lockKeys); @Override void branchReport(BranchType branchType, String xid, long branchId, BranchStatus status,
                             String applicationData); @Override boolean lockQuery(BranchType branchType, String resourceId, String xid, String lockKeys); @Override BranchStatus branchCommit(GlobalSession globalSession, BranchSession branchSession); @Override BranchStatus branchRollback(GlobalSession globalSession, BranchSession branchSession); @Override String begin(String applicationId, String transactionServiceGroup, String name, int timeout); @Override GlobalStatus commit(String xid); @Override boolean doGlobalCommit(GlobalSession globalSession, boolean retrying); @Override GlobalStatus rollback(String xid); @Override boolean doGlobalRollback(GlobalSession globalSession, boolean retrying); @Override GlobalStatus getStatus(String xid); @Override GlobalStatus globalReport(String xid, GlobalStatus globalStatus); @Override void doGlobalReport(GlobalSession globalSession, String xid, GlobalStatus globalStatus);  }### Answer:
@Test public void beginTest() throws Exception { String xid = core.begin(applicationId, txServiceGroup, txName, timeout); globalSession = SessionHolder.findGlobalSession(xid); Assertions.assertNotNull(globalSession); }