package scb.business.etransaction.ejb;

import java.math.BigDecimal;
import java.rmi.RemoteException;
import java.sql.Date;
import java.sql.Time;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;

import javax.ejb.FinderException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.SessionContext;
import javax.jms.Message;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;

import com.ebbs.services.TransactionInterface;
import com.ebbs.services.TransactionProxy;
import com.scb.ebbs.event.util.EventProcessorImpl;
import com.scb.ebbs.event.wrapper.EventMessageWrapper;

import mockit.Deencapsulation;
import mockit.Expectations;
import mockit.Injectable;
import mockit.Mock;
import mockit.MockUp;
import mockit.Mocked;
import mockit.NonStrictExpectations;
import mockit.Tested;
import mockit.integration.junit4.JMockit;
import scb.business.eadvices.ejb.AdvicesEntityHome;
import scb.business.eadvices.factory.AdvicesDAOFactory;
import scb.business.eatm.ejb.CardDetailsEntity;
import scb.business.eatm.ejb.CardDetailsEntityHome;
import scb.business.eatm.ejb.CardDetailsEntityKey;
import scb.business.eatm.wrapper.ATMISOBusinessParamWrapper;
import scb.business.eatm.wrapper.CardDetailsWrapper;
import scb.business.ebatch.wrapper.EODServiceParamWrapper;
import scb.business.ebatch.wrapper.EODWrapper;
import scb.business.einstructions.ejb.ECAPSInstructionsEntity;
import scb.business.einstructions.ejb.ECAPSInstructionsEntityHome;
import scb.business.einstructions.ejb.ECAPSInstructionsEntityKey;
import scb.business.einstructions.ejb.ECAPSInstructionsHistoryEntityHome;
import scb.business.einstructions.ejb.InstructionEntity;
import scb.business.einstructions.ejb.InstructionEntityHome;
import scb.business.einstructions.ejb.InstructionEntityKey;
import scb.business.einstructions.ejb.InstructionHistoryEntityHome;
import scb.business.einstructions.factory.ECAPSInstructionsDAOFactory;
import scb.business.einstructions.factory.InstructionDAOFactory;
import scb.business.einstructions.wrapper.ECAPSInstructionsWrapper;
import scb.business.einstructions.wrapper.InstructionWrapper;
import scb.business.einterest.ejb.InterestAccrualEntityHome;
import scb.business.einterest.ejb.InterestCodeCacheForCapitalisation;
import scb.business.einterest.ejb.InterestSession;
import scb.business.einterest.ejb.InterestSessionHome;
import scb.business.einterest.factory.InterestAccrualDAOFactory;
import scb.business.einterest.wrapper.InterestAccrualWrapper;
import scb.business.einterest.wrapper.InterestWrapper;
import scb.business.einterface.ejb.SingleViewUploadEntity;
import scb.business.einterface.ejb.SingleViewUploadEntityHome;
import scb.business.einterface.ejb.SingleViewUploadHelper;
import scb.business.einterface.wrapper.SingleViewWrapper;
import scb.business.elimits.ejb.ExcessSessionHome;
import scb.business.erisk.ejb.RiskIndicatorEntityHome;
import scb.business.etransaction.factory.StatisticalFieldsDAOFactory;
import scb.business.etransaction.factory.TPSDAOFactory;
import scb.business.etransaction.wrapper.BalanceStatisticsWrapper;
import scb.business.etransaction.factory.PostEngineDAOFactory;
import scb.business.erisk.wrapper.RiskIndicatorWrapper;
import scb.business.etransaction.factory.LevyDAOFactory;
import scb.business.etransaction.factory.TPSDAOFactory;
import scb.business.etransaction.wrapper.LevyWrapper;
import scb.business.etransaction.wrapper.TransactionBatchWrapper;
import scb.business.etransaction.wrapper.TransactionStatisticsWrapper;
import scb.business.etransaction.wrapper.TransactionWrapper;
import scb.business.etransactions.ejb.TransactionBusinessLocalSession;
import scb.ebbs.accounts.ejb.AccountMasterEntity;
import scb.ebbs.accounts.ejb.AccountMasterEntityHome;
import scb.ebbs.accounts.ejb.AccountMasterEntityKey;
import scb.ebbs.accounts.ejb.DirectDebitMandateEntity;
import scb.ebbs.accounts.ejb.DirectDebitMandateEntityHome;
import scb.ebbs.accounts.ejb.DirectDebitMandateEntityKey;
import scb.ebbs.accounts.ejb.SubsidiaryAccountEntity;
import scb.ebbs.accounts.ejb.SubsidiaryAccountEntityBean;
import scb.ebbs.accounts.ejb.SubsidiaryAccountEntityHome;
import scb.ebbs.accounts.ejb.SubsidiaryAccountEntityKey;
import scb.ebbs.accounts.ejb.PassbookEntity;
import scb.ebbs.accounts.ejb.PassbookEntityHome;
import scb.ebbs.accounts.ejb.SubsidiaryAccountSession;
import scb.ebbs.accounts.ejb.SubsidiaryAccountSessionHome;
import scb.ebbs.accounts.factory.PassbookDAOFactory;
import scb.ebbs.accounts.factory.DirectDebitMandateDAOFactory;
import scb.ebbs.accounts.wrapper.AccountMasterWrapper;
import scb.ebbs.accounts.wrapper.DirectDebitMandateChildWrapper;
import scb.ebbs.accounts.wrapper.DirectDebitMandateWrapper;
import scb.ebbs.accounts.wrapper.SubsidiaryAccountWrapper;
import scb.ebbs.ecodes.ejb.BranchEntity;
import scb.ebbs.ecodes.ejb.BranchEntityHome;
import scb.ebbs.ecodes.ejb.BranchEntityKey;
import scb.ebbs.ecodes.ejb.IDGeneratorSession;
import scb.ebbs.ecodes.ejb.ProductEntity;
import scb.ebbs.ecodes.ejb.StatisticalGroupEntity;
import scb.ebbs.accounts.factory.SubsidiaryAccountDAOFactory;
import scb.ebbs.accounts.wrapper.MasterRelationshipWrapper;
import scb.ebbs.accounts.wrapper.PassbookWrapper;
import scb.ebbs.ecodes.ejb.ProductEntityBean;
import scb.ebbs.ecodes.ejb.ProductEntityHome;
import scb.ebbs.ecodes.ejb.ProductEntityKey;
import scb.ebbs.ecodes.ejb.ProductHelper;
import scb.ebbs.ecodes.factory.ProductDAOFactory;
import scb.ebbs.ecodes.wrapper.AccountBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.GBABusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.InterfaceBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.MCABusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.ProductWrapper;
import scb.ebbs.ecodes.wrapper.RelationshipBusinessParamWrapper;
import scb.ebbs.ecodes.ejb.StatisticalGroupEntityHome;
import scb.ebbs.ecodes.ejb.StatisticalGroupEntityKey;
import scb.ebbs.ecodes.wrapper.ABHInterestBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.AadharOTPBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.AccountBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.AsiaMilesBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.BranchWrapper;
import scb.ebbs.ecodes.wrapper.InterestBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.LevyBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.LevyTrnMapBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.RelationshipBusinessParamWrapper;
import scb.ebbs.ecodes.wrapper.StatisticalGroupWrapper;
import scb.ebbs.ecodes.wrapper.SystemWrapper;
import scb.ebbs.ecustomer.ejb.RelationshipEntity;
import scb.ebbs.ecustomer.ejb.RelationshipEntityHome;
import scb.ebbs.ecustomer.ejb.RelationshipSession;
import scb.ebbs.ecustomer.ejb.RelationshipSessionHome;
import scb.ebbs.ecustomer.factory.RelationshipDAOFactory;
import scb.ebbs.ecustomer.wrapper.RelationshipStatusUpdateParamWrapper;
import scb.ebbs.etax.wrapper.VATCodeForChargeSetupWrapper;
import scb.ebbs.statements.ejb.ConsolidatedStatementEntityHome;
import scb.ebbs.statements.ejb.ConsolidatedStatementEntityKey;
import scb.ebbs.ecustomer.wrapper.RelationshipWrapper;
import scb.ebbs.util.EBBSBusinessProcessConstants;
import scb.ebbs.util.NarrationHandler;
import scb.ebbs.util.StaticDataCache;
import scb.exception.SCBApplicationException;
import scb.general.ejb.BusinessProcessParamCache;
import scb.general.wrapper.BusinessProcessConstants;
import scb.general.wrapper.EventBusinessParamWrapper;
import scb.general.wrapper.GeneralParamWrapper;
import scb.message.process.MQChannelProcess;
import scb.message.wrapper.MessageWrapper;
import scb.solace.message.session.MessageSenderSession;
import scb.process.QuerySession;
import scb.process.QuerySessionHome;
import scb.services.util.ICMUtil;
import scb.util.BusinessEvent;
import scb.util.EBBSConstants;
import scb.util.EventProcessor;
import scb.util.ATMISOConstants;
import scb.util.BusinessInfo;
import scb.util.CurrencyUtility;
import scb.util.DBAgnosticUtility;
import scb.util.DateUtility;
import scb.util.LogWriter;
import scb.util.SQLExecutor;
import scb.util.SQLResultObject;
import scb.util.SystemProperties;
import scb.util.Utility;
import scb.wrapper.AbstractWrapper;
import scb.wrapper.Helper;
import scb.wrapper.PrimaryKey;
import scb.wrapper.StatisticalGroupProcess;
import scb.wrapper.UserDetail;
import com.scb.ebbs.event.framework.EventMesssageJsonGenerator;

import scb.wrapper.RequestInfo;
import com.ebbs.wrapper.BalanceComputationWrapper;
/**
 * Generated by JUnitDoclet, a tool provided by ObjectFab GmbH under LGPL.
 * Please see www.junitdoclet.org, www.gnu.org and www.objectfab.de for
 * informations about the tool, the licence and the authors.
 */

@RunWith(value = JMockit.class)
public class PostEngineSessionBeanTest {
	// JUnitDoclet begin class
	@Tested
	scb.business.etransaction.ejb.PostEngineSessionBean postenginesessionbean;
	// JUnitDoclet end class

	@Mocked
	SQLExecutor con;

	@Mocked
	javax.ejb.SessionContext mySessionCtx;

	@Mocked
	EODWrapper eodWrapper;
	
//	@Mocked
//	StaticDataCache staticDataCache;

	@Mocked
	SystemProperties systemProperties;

	@Mocked
	BusinessProcessParamCache businessProcessParamCache;

	@Mocked
	AbstractWrapper[] abstractWrapper;

	/* @Mocked
	AbstractWrapper[] casaSTPLimitAbstractWrapper;

	@Mocked
	PreviousTransactionStatisticsEntityHome previousTransactionStatisticsEntityHome;

	@Mocked
	CurrencyUtility currencyUtility;

	@Mocked
	BusinessInfo businessInfo;
	@Mocked
	SystemWrapper systemWrapper;
	@Mocked
	DateUtility dateutility;
	@Mocked
	PreviousTransactionStatisticsEntity previousTransactionStatisticsEntity;
	@Mocked
	PreviousTransactionStatisticsEntityKey previousTransactionStatisticsEntityKey;
	@Mocked
	TransactionStatisticsWrapper transactionStatisticsWrapper;
	@Mocked
	CurrentTransactionStatisticsEntity currentTransactionStatisticsEntity;
	@Mocked
	CurrentTransactionStatisticsEntityHome currentTransactionStatisticsEntityHome;
	@Mocked
	CurrentTransactionStatisticsEntityKey currentTransactionStatisticsEntityKey;
	@Mocked
	StaticDataCache staticDataCache;
	@Mocked
	RealTimePostTransationProcess realTimePostTransationProcess;*/
	
	@Mocked
	SingleViewUploadEntityHome singleViewUploadEntityHome;
	@Mocked
	SingleViewWrapper sWrapper;
	@Mocked
	SingleViewUploadHelper sHelper;
	@Mocked
	Helper helper;
	@Mocked
	LogWriter log;
	
	@Mocked LevyDAOFactory levyDAOFactory;
	@Mocked LevyEntity levyEntity;
	@Mocked LevyEntityHome levyEntityHome;
	@Mocked LevyEntityKey levyEntityKey;
	@Mocked LevyWrapper levyWrapper;
	@Mocked LevyTrnMapBusinessParamWrapper levyTrnMapBPPWrapper;
	@Mocked AccountMasterEntity masterEntity;
	@Mocked AccountMasterEntityHome accountMasterEntityHome;
	@Mocked LevyHelper levyHelper;
	@Mocked Message resMessage ;
	@Mocked MessageSenderSession messageSenderSession;
	@Mocked NarrationHandler narrationHandler;
	@Mocked BranchEntityHome branchEntityHome;
	@Mocked BranchEntity branchEntity;

	@Mocked
	EventMesssageJsonGenerator evtmsgGenerator;

	@Mocked
	EventProcessorImpl eventProcessorImpl;
	@Mocked
	CardDetailsEntityHome cardDetailsEntityHome;
	
	@Mocked
	CardDetailsEntity mainEntity; 
	
	@Mocked	
	CardDetailsWrapper cardDetailsWrapper;

	@Mocked
	SQLResultObject trnRs;		
	//@Mocked
	//EODWrapper eodWrapper;
	@Mocked
	DirectDebitMandateDAOFactory DirectDebitMandateDAOFactory;
	@Mocked
	DirectDebitMandateEntityHome directDebitMandateEntityHome;
	@Mocked
	DirectDebitMandateEntity directDebitMandateEntity;
	@Mocked
	DirectDebitMandateDAOFactory directDebitMandateDAOFactory;
	@Mocked
	DirectDebitMandateEntityKey directDebitMandateEntityKey;
	@Mocked
	SessionContext sessionContext;
	@Mocked
	TPSDAOFactory TPSDAOFactory;
	@Mocked
	IntermediateTransactionEntityHome intermediateTransactionEntityHome;
	@Mocked
	IntermediateTransactionEntity intermediateTransactionEntity;
	@Mocked
	IDGeneratorSession idGeneratorSession;
	@Mocked
	SubsidiaryAccountEntityHome subsidiaryAccountEntityHome;
	@Mocked
	SubsidiaryAccountEntity subsidiaryAccountEntity;
	@Mocked
	InterestCodeCacheForCapitalisation interestCodeCacheForCapitalisation;
	@Mocked
	TransactionArchiveEntityHome transactionArchiveEntityHome;
	@Mocked
	BalanceQueueEntityHome balanceQueueEntityHome;
	@Mocked
	SubsidiaryAccountWrapper subsidiaryAccountWrapper;

	@Mocked
	InstructionEntityHome insEntityHome;
	@Mocked
	InstructionHistoryEntityHome insHisEntityHome;
	@Mocked
	ECAPSInstructionsEntityHome eCAPSInstructionsHome;
	@Mocked
	ECAPSInstructionsHistoryEntityHome cardinsHisEntityHome;
	@Mocked
	InstructionEntity insEntity;
	@Mocked
	InstructionWrapper instructionWrapper;
	@Mocked
	InstructionWrapper insWrapper;
	@Mocked
	ECAPSInstructionsEntity ECAPSInstructionsEntity;
	@Mocked
	ECAPSInstructionsWrapper cardinstructionWrapper;
	@Mocked
	RiskIndicatorEntityHome riskIndicatorEntityHome;
	
	@Mocked
	EODTransactionsCache eodTransactionsCache;
	
	@Mocked
	ExcessSessionHome excessSessionHome;
	
	@Mocked
	CurrencyUtility currencyUtility;
	
	@Mocked
	BusinessInfo businessInfo;
	
	@Mocked
	SystemWrapper systemWrapper;
	
	@Mocked
	DateUtility dateUtility;
	
	@Mocked
	SubsidiaryAccountEntityBean subsidiaryAccountEntityBean;
	
	@Mocked
	BalanceQueueEntityBean balanceQueueEntityBean;
	
	@Mocked
	BalanceQueueEntity balanceQueueEntity;
	
	@Mocked
	AccountsQueueEntityHome accountsQueueEnityHome;
	
	@Mocked
	CurrentTransactionStatisticsEntityHome currentTransactionStatisticsEntityHome;
	
	@Mocked
	CurrentTransactionStatisticsEntity currentTransactionStatisticsEntity;
	
	@Mocked
	PreviousTransactionStatisticsEntityHome previousTransactionStatisticsEntityHome;
	
	@Mocked
	PreviousTransactionStatisticsEntity previousTransactionStatisticsEntity;
	
	@Mocked
	StatisticalGroupEntityHome statisticalGroupEntityHome;
	
	@Mocked
	StatisticalGroupEntity statisticalGroupEntity;
	
	@Mocked
	StatisticalGroupProcess statisticalGroupProcess;
	
	@Mocked PreviousTransactionStatisticsEntityKey previousTransactionStatisticsEntityKey;
	
	@Injectable TransactionStatisticsWrapper previousTransactionStatisticsWrapper;
	
	@Mocked	RelationshipSessionHome relationshipSessionHome;
	@Mocked	RelationshipSession relationshipSession;
	@Mocked	ConsolidatedStatementEntityHome consolidatedStatementEntityHome;
	@Mocked	PassbookEntityHome passbookEntityHome;
	@Mocked	CurrentInterestBearingBalanceStatisticsEntityHome currentInterestBearingBalanceStatisticsEntityHome;
	@Mocked	SubsidiaryAccountDAOFactory subsidiaryAccountDAOFactory;
	@Mocked	SubsidiaryAccountEntityKey subsidiaryAccountEntityKey;
	@Mocked	SubsidiaryAccountSessionHome subsidiaryAccountSessionHome;
	@Injectable SubsidiaryAccountSession subsidiaryAccountSession;
	@Mocked	ProductDAOFactory productDAOFactory;
	@Mocked	ProductEntityHome productEntityHome;
	@Mocked	ProductEntity productEntity;
	@Mocked	ProductEntityBean productEntityBean;
	@Mocked	ProductEntityKey productEntityKey;
	@Mocked	ProductHelper productHelper;
	@Mocked	LogWriter logWriter;
	@Mocked	ProductWrapper productWrapper;
	@Mocked	AccountMasterWrapper accountMasterWrapper;
	@Mocked	PassbookDAOFactory passbookDAOFactory;
	@Mocked	PassbookEntity passbookEntity;
	@Mocked	PassbookWrapper passbookWrapper;
	@Mocked	RelationshipWrapper relationshipWrapper;
	@Mocked	RelationshipStatusUpdateParamWrapper relStatusParamWrapper;
	@Mocked	RelationshipEntity relationshipEntity;
	@Mocked	RelationshipEntityHome relationshipEntityHome;
	@Mocked	RelationshipDAOFactory relationshipDAOFactory;
	@Mocked	QuerySession querySession;
	@Mocked	QuerySessionHome querySessionHome;
	@Mocked	AdvicesDAOFactory advicesDAOFactory;
	@Mocked	AdvicesEntityHome advicesEntityHome;
	@Mocked	InterestAccrualWrapper interestAccrualWrapper;
	@Mocked	InterestAccrualDAOFactory interestAccrualDAOFactory;
	@Mocked	InterestAccrualEntityHome interestAccrualEntityHome;
	@Mocked	FrontEndBalanceEntityHome frontEndBalanceEntityHome;
	@Mocked	BackendBalanceEntityHome backendBalanceEntityHome;
	@Mocked	TPSDAOFactory tpsDAOFactory;
	@Mocked	PostEngineDAOFactory postEngineDAOFactory;
	@Mocked	InterestSession interestSession;
	@Mocked	InterestSessionHome interestSessionHome;
	@Mocked InterestWrapper interestWrapper;
	@Mocked GBABusinessParamWrapper gbaBppWarpper;
	@Mocked	AbstractWrapper[] gbaAbstractWrapper;
	@Mocked	AbstractWrapper[] mcaAbstractWrapper;
	@Mocked	MCABusinessParamWrapper mcaBusinessParamWrapper;
	@Mocked EventProcessor eventProcessor;
	@Mocked ICMUtil icmUtil;
	@Mocked BusinessEvent argBusinessEvent;
	@Mocked RequestInfo reqInfo;
	@Mocked StatisticalFieldsDAOFactory statisticalFieldsDAOFactory;
	@Mocked CurrentBalanceStatisticsEntityHome currentBalanceStatisticsEntityHome;
	@Mocked CurrentBalanceStatisticsEntity currentBalanceStatisticsEntity;
	@Mocked CurrentBalanceStatisticsEntityKey currentBalanceStatisticsEntityKey;
	@Mocked CurrentInterestBearingBalanceStatisticsEntity currentInterestBearingBalanceStatisticsEntity;
	@Mocked CurrentInterestBearingBalanceStatisticsEntityKey currentInterestBearingBalanceStatisticsEntityKey;
	@Mocked BalanceStatisticsWrapper balanceStatisticsWrapper;
	
	java.lang.String stTest = "123456";


	@Before
	public void beforeInit() {

		// lets mock the Utility.getCompanyID
		new MockUp<Utility>() {
			@Mock
			String getCompanyID() {
				return "SCB";
			}
		};
		
		new MockUp<StaticDataCache>() {
 			@Mock StaticDataCache getInstance() throws SCBApplicationException {
 					return new StaticDataCache();
 				}
 			@Mock Object getSysRefValue(String argFieldName) {
 				return "xxx";
 				}
 			@Mock AbstractWrapper getSystemWrapper() {
 				return new SystemWrapper();
 				}
 		};
 		
 		systemWrapper.systemDate=Date.valueOf("2024-06-15");

	}

	//@Test
	public void testProcessBulkTokenizationMaskingSinview(@Mocked final ATMISOBusinessParamWrapper atmisoWrapper, @Mocked final SingleViewUploadEntity singleViewUploadEntity) throws Exception {
		// JUnitDoclet begin method invokeProcess
		PostEngineSessionBean postSession = new PostEngineSessionBean();
		EODWrapper eodWrapper = new EODWrapper();

		eodWrapper.data = new Object[1];

		Object[] obj = new Object[] { "0027", "5243551022100711", "01S1783768J", "2" };

		eodWrapper.data[0] = obj;

		final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
		abstractWrappers[0] = getData();

		sWrapper.tokenisedCardNumber = "5243551022100711";
		sWrapper.refNo = "5243551022100711";

		new NonStrictExpectations() {
			{
				Deencapsulation.invoke(log, "getInstance");
				result = log;
			}
			{
				BusinessProcessParamCache.getInstance();
				result = businessProcessParamCache;
			}
			{
				businessProcessParamCache.getProcessParameters(ATMISOConstants.CARD_MASKING);
				result = abstractWrappers;
			}
			{
				eodWrapper.getNextElement();
				result = null;
			}
		};

		Deencapsulation.setField(postSession, "singleViewUploadEntityHome", singleViewUploadEntityHome);
		postSession.processBulkTokenizationMaskingSinview(eodWrapper);
		// JUnitDoclet end method invokeProcess
	}

	//@Test
	public void processRealTimePostFailedTransactions(@Mocked final EODWrapper eodWrapper, @Mocked final IntermediateTransactionEntityHome intermediateTransactionEntityHome,
			@Mocked final IntermediateTransactionEntity intermediateTransactionEntity, @Mocked final TransactionBatchWrapper transactionBatchWrapper, @Mocked final MQChannelProcess channelProcess,
			@Mocked final MessageWrapper messageWrapper) throws SCBApplicationException, RemoteException, FinderException {

		new NonStrictExpectations() {
			{
				Deencapsulation.invoke(log, "getInstance");
				result = log;
			}
			{
				eodWrapper.getNextElement();
				returns(new Object[] { "branch1", "channel1", new java.sql.Date(3), "008732" }, new Object[] { "branch2", "channel2", new java.sql.Date(3), "978637" }, null);
			}
			{
				intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey) any);
				result = intermediateTransactionEntity;
			}
			{
				intermediateTransactionEntity.getWrapper();
				result = transactionBatchWrapper;
			}
			{
				channelProcess.process(messageWrapper);
				result = messageWrapper;
			}
		};
		// lets mock the Utility.getCompanyID
		new MockUp<Utility>() {

			@Mock
			String getCompanyID() {
				return "SCB";
			}
		};

		Deencapsulation.setField(postenginesessionbean, "intermediateTransactionEntityHome", intermediateTransactionEntityHome);

		postenginesessionbean.processRealTimePostFailedTransactions(eodWrapper);
	}

	//@Test
	public void testProcessBulkTokenizationMasking() throws Exception {
		// JUnitDoclet begin method invokeProcess
		final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
		ATMISOBusinessParamWrapper paramWrap = new ATMISOBusinessParamWrapper();
		paramWrap.enableCrdTokenisation = "C";
		abstractWrappers[0] = paramWrap;

		final AbstractWrapper[] abstractWrapper = new AbstractWrapper[1];
		abstractWrapper[0] = getData();

		PostEngineSessionBean postSession = new PostEngineSessionBean();
		EODWrapper eodWrapper = new EODWrapper();
		EODServiceParamWrapper[] servparamarray = new EODServiceParamWrapper[1];
		EODServiceParamWrapper eodsrvparam = new EODServiceParamWrapper();
		eodsrvparam.srvParamValue = "service";
		servparamarray[0] = eodsrvparam;
		eodWrapper.serviceParameters = servparamarray;
		eodWrapper.data = new Object[2];
		Object[] obj = new Object[] {

				"0100000000017669", // relno

		};

		eodWrapper.data[0] = obj;
		obj = new Object[] {

				"01S0004804F" // relno
		};

		eodWrapper.data[1] = obj;

		new NonStrictExpectations() {
			{
				Deencapsulation.invoke(log, "getInstance");
				result = log;
			}
			{
				BusinessProcessParamCache.getInstance();
				result = businessProcessParamCache;
			}
			{
				businessProcessParamCache.getProcessParameters(ATMISOConstants.CARD_MASKING);
				result = abstractWrappers;
			}

		};

		postSession.processBulkTokenizationMasking(eodWrapper);
		// JUnitDoclet end method invokeProcess
	}
	
	//@Test
	public void testProcessBulkDetokenizationMaskingSinview() throws Exception {
		// JUnitDoclet begin method invokeProcess
		final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
		ATMISOBusinessParamWrapper paramWrap = new ATMISOBusinessParamWrapper();
		paramWrap.enableCrdTokenisation = "C";
		abstractWrappers[0] = paramWrap;

		final AbstractWrapper[] abstractWrapper = new AbstractWrapper[1];
		abstractWrapper[0] = getData();

		PostEngineSessionBean postSession = new PostEngineSessionBean();
		EODWrapper eodWrapper = new EODWrapper();
		EODServiceParamWrapper[] servparamarray = new EODServiceParamWrapper[1];
		EODServiceParamWrapper eodsrvparam = new EODServiceParamWrapper();
		eodsrvparam.srvParamValue = "service";
		servparamarray[0] = eodsrvparam;
		eodWrapper.serviceParameters = servparamarray;
		eodWrapper.data = new Object[2];
		Object[] obj = new Object[] {

				"0027","5498341691685222","01S8706113B","1" // relno

		};

		eodWrapper.data[0] = obj;
		obj = new Object[] {

				"0027","4231791733904740","01S7416413G","1" // relno
		};

		eodWrapper.data[1] = obj;

		new NonStrictExpectations() {
			{
				Deencapsulation.invoke(log, "getInstance");
				result = log;
			}
			{
				BusinessProcessParamCache.getInstance();
				result = businessProcessParamCache;
			}
			{
				businessProcessParamCache.getProcessParameters(ATMISOConstants.CARD_MASKING);
				result = abstractWrappers;
			}

		};

		postSession.processBulkDetokenizationMaskingSinview(eodWrapper);
		// JUnitDoclet end method invokeProcess
	}

	/**
	 * JUnitDoclet moves marker to this method, if there is not match for them
	 * in the regenerated code and if the marker is not empty. This way, no test
	 * gets lost when regenerating after renaming. Method testVault is supposed
	 * to be empty.
	 * 
	 * @throws Exception
	 *             Any exception the enclosed code may throw.
	 */
	//@Test
	public void testVault() throws Exception {
		// JUnitDoclet begin method testcase.testVault
		// JUnitDoclet end method testcase.testVault
	}
	
	public ATMISOBusinessParamWrapper getData() {
		ATMISOBusinessParamWrapper dataBppWraper = new ATMISOBusinessParamWrapper();
		dataBppWraper.enableCrdTokenisation = "H";
		return dataBppWraper;
	}
	
	//@Test
	public void testTransactionUploadEventPublish() {
		try {
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			try {
				new NonStrictExpectations() {
					{
						//eodWrapper.register();
						eodWrapper.getNextElement();
						result = transactionWrapper1;
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.transactionUploadEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	
	//@Test
	public void testTransactionUploadEventPublish_1() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("ICDD");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			try {
				new NonStrictExpectations() {
					{
						eodWrapper.getNextElement();
						returns(transactionWrapper1, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.transactionUploadEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	
	//@Test
	public void testTransactionEventPublish() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("ICDD");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			
			Object[] eventDataArray = new Object[21];
			//eventDataArray[20] = "ICDD";
			eventDataArray[19] = "12345|334|445|443|2022-12-12";//EVENTKEY
			eventDataArray[0] = "TRN_ONL_EVT_STORE";//Table Name
			eventDataArray[4] = "2022-12-12";
			eventDataArray[3] = "Nexus123";
			
			Map<String,List<Object[]>> eventConfigDataMap = new HashMap<>();
			List<Object[]> eventConfigDataList = new ArrayList<>();
			Object[] eventDataArray1 = new Object[21];
			eventDataArray[0] = "TRN_ONL_EVT_STORE";
			eventDataArray[1] = "123";
			eventDataArray[2] = "123";
			eventDataArray[3] = "123";
			eventConfigDataList.add(eventDataArray1);
			eventConfigDataMap.put("Nexus",eventConfigDataList);
			Deencapsulation.setField(postenginesessionbean, "eventConfigDataMap", eventConfigDataMap);
			try {
				new NonStrictExpectations() {
					{
						eodWrapper.getNextElement();
						returns(eventDataArray, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.transactionEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	
	//@Test
	public void testStaticEventPublish() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("ICDD");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			
			Object[] eventDataArray = new Object[20];
			eventDataArray[20] = "ICDD";
			try {
				new NonStrictExpectations() {
					{
						eodWrapper.getNextElement();
						returns(eventDataArray, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.staticEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	//@Test
	public void testProcessBulkTokenizationMaskingSinview() throws Exception {
		// JUnitDoclet begin method invokeProcess
		PostEngineSessionBean postSession = new PostEngineSessionBean();
		EODWrapper eodWrapper = new EODWrapper(); 
		EODServiceParamWrapper serviceParamWrapper = new EODServiceParamWrapper();
			 serviceParamWrapper.srvParamSeqNo="001";
			serviceParamWrapper.srvParamValue="PCDISS";
			EODServiceParamWrapper[] eODServiceParamWrapper = new EODServiceParamWrapper[1];
					      eODServiceParamWrapper[0] = serviceParamWrapper;
					      eodWrapper.serviceParameters=eODServiceParamWrapper; 
			 
		final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
		abstractWrappers[0] = getData();
		
		int iObjCount = 0;
    	Object[] objArr = new Object[4];
    	objArr[iObjCount++] = "0027";
    	objArr[iObjCount++]="5243551022100711";
    	objArr[iObjCount++]="4224243256";
    	objArr[iObjCount++]="1";

		new NonStrictExpectations() {
			{
				Deencapsulation.invoke(log, "getInstance");
				result = log;
			}
			{
				BusinessProcessParamCache.getInstance();
				result = businessProcessParamCache;
			}
			{
				businessProcessParamCache.getProcessParameters(ATMISOConstants.CARD_MASKING);
				result = abstractWrappers;
			}
			{
				eodWrapper.getNextElement();result = objArr;result=null;
			}
		};

		Deencapsulation.setField(postSession, "singleViewUploadEntityHome", singleViewUploadEntityHome);
		postSession.processBulkTokenizationMaskingSinview(eodWrapper);
		// JUnitDoclet end method invokeProcess
	}
	

	/*@Test
	public void testProcessBulkDetokenizationMaskingSinview() throws Exception{
		// JUnitDoclet begin method invokeProcess
				PostEngineSessionBean postSession = new PostEngineSessionBean();
				EODWrapper eodWrapper = new EODWrapper(); 
				EODServiceParamWrapper serviceParamWrapper = new EODServiceParamWrapper();
					 serviceParamWrapper.srvParamSeqNo="001";
					 serviceParamWrapper.srvParamValue="PCDISS";
					EODServiceParamWrapper[] eODServiceParamWrapper = new EODServiceParamWrapper[1];
							      eODServiceParamWrapper[0] = serviceParamWrapper;
							      eodWrapper.serviceParameters=eODServiceParamWrapper; 
					 
				final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
				abstractWrappers[0] = getData();

				int iObjCount = 0;
		    	Object[] objArr = new Object[4];
		    	objArr[iObjCount++] = "0027";
		    	objArr[iObjCount++]="5243551022100711";
		    	objArr[iObjCount++]="4224243256";
		    	objArr[iObjCount++]="1";

				new NonStrictExpectations() {
					{
						Deencapsulation.invoke(log, "getInstance");
						result = log;
					}
					{
						BusinessProcessParamCache.getInstance();
						result = businessProcessParamCache;
					}
					{
						businessProcessParamCache.getProcessParameters(ATMISOConstants.CARD_MASKING);
						result = abstractWrappers;
					}
					{
						eodWrapper.getNextElement();result = objArr;result=null;
					}
				};

	    Deencapsulation.setField(postSession, "singleViewUploadEntityHome", singleViewUploadEntityHome);
	    
		postSession.processBulkDetokenizationMaskingSinview(eodWrapper);
			
	}*/

	//@Test
	public void testProcessBulkTokenizationMaskingPCIDSS(@Mocked EODWrapper eODWrapper) throws Exception{
		// JUnitDoclet begin method invokeProcess
				PostEngineSessionBean postSession = new PostEngineSessionBean();
				EODWrapper eodWrapper = new EODWrapper(); 
				EODServiceParamWrapper serviceParamWrapper = new EODServiceParamWrapper();
					 serviceParamWrapper.srvParamSeqNo="001";
					 serviceParamWrapper.srvParamValue="recordCount:100";
					EODServiceParamWrapper[] eODServiceParamWrapper = new EODServiceParamWrapper[1];
							      eODServiceParamWrapper[0] = serviceParamWrapper;
							      eodWrapper.serviceParameters=eODServiceParamWrapper; 
							     
				final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
				ATMISOBusinessParamWrapper atmisoWrapper = new ATMISOBusinessParamWrapper();
				atmisoWrapper.enableCrdTokenisation="C";
				
				abstractWrappers[0] = atmisoWrapper;
				
				int iObjCount = 0;
		    	Object[] objArr = new Object[2];
		    	objArr[iObjCount++] = "0";
		    	objArr[iObjCount++]="5";

				new NonStrictExpectations() {
					{
						Deencapsulation.invoke(log, "getInstance");
						result = log;
					}
					{
						BusinessProcessParamCache.getInstance();
						result = businessProcessParamCache;
					}
					{
						businessProcessParamCache.getProcessParameters(ATMISOConstants.CARD_MASKING);
						result = abstractWrappers;
					}
					{
						eodWrapper.getNextElement();result = objArr;result=null;
					}
					{   cardDetailsEntityHome.findByPrimaryKey((CardDetailsEntityKey)any);
					    result= mainEntity;
					}
					  
					{   mainEntity.getWrapper(); 
					    result=cardDetailsWrapper;
					}
				};

	    Deencapsulation.setField(postSession, "cardHome", cardDetailsEntityHome);
	    
	    postSession.processBulkTokenizationMaskingPCIDSS(eodWrapper);
			
	}
	
	//@Test
	public void testProcessDebitCardBulkDeTokenizationUnMaskingPCIDSS() throws Exception{
		PostEngineSessionBean postSession = new PostEngineSessionBean();
		EODWrapper eodWrapper = new EODWrapper(); 
		EODServiceParamWrapper serviceParamWrapper = new EODServiceParamWrapper();
			 serviceParamWrapper.srvParamSeqNo="001";
			 serviceParamWrapper.srvParamValue="recordCount:100";
			EODServiceParamWrapper[] eODServiceParamWrapper = new EODServiceParamWrapper[1];
					      eODServiceParamWrapper[0] = serviceParamWrapper;
					      eodWrapper.serviceParameters=eODServiceParamWrapper; 
					    
		int iObjCount = 0;
    	Object[] objArr = new Object[2];
    	objArr[iObjCount++] = "0";
    	objArr[iObjCount++]="5";

		new NonStrictExpectations() {
			{
				Deencapsulation.invoke(log, "getInstance");
				result = log;
			}
			{
				eodWrapper.getNextElement();result = objArr;result=null;
			}
			{   cardDetailsEntityHome.findByPrimaryKey((CardDetailsEntityKey)any);
			    result= mainEntity;
			 }
			  
			{   mainEntity.getWrapper(); 
			    result=cardDetailsWrapper;    
			}
		};

               Deencapsulation.setField(postSession, "cardHome", cardDetailsEntityHome);

               postSession.processDebitCardBulkDeTokenizationUnMaskingPCIDSS(eodWrapper);
		}
	
	//@Test
	public void testStaticEventPublishSuppressSourceSystem() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("ICDD");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			
			Object[] eventDataArray = new Object[20];
			eventDataArray[19] = "ICDD";
			EventBusinessParamWrapper evntBusinessParamWrapper=new EventBusinessParamWrapper();
			evntBusinessParamWrapper.setSuppressCustomerEvents("Nexus");
			try {
				new NonStrictExpectations() {
					{
						eodWrapper.getNextElement();
						returns(eventDataArray, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						businessProcessParamCache.getProcessParameters("EVENTALERT");
						result=evntBusinessParamWrapper;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.staticEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	
	
	//@Test
	public void testStaticEventPublishNexusEventStatusUpdate() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("ICDD");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			
			Object[] eventDataArray = new Object[20];
			eventDataArray[10] = 1;
			eventDataArray[19] = "Nexus";
			EventBusinessParamWrapper evntBusinessParamWrapper=new EventBusinessParamWrapper();
			evntBusinessParamWrapper.setSuppressCustomerEvents("Nexus");
			
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			try {
				new NonStrictExpectations() {
					{
						eodWrapper.getNextElement();
						returns(eventDataArray, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						businessProcessParamCache.getProcessParameters("EVENTALERT");
						result=evntBusinessParamWrapper;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.staticEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	
	@Test
	public void testReversalTransactions(@Mocked
			StaticDataCache staticDataCache,@Mocked
			DBAgnosticUtility dbAgnosticUtility,
			@Mocked
			SystemProperties systemProperties, @Mocked SystemWrapper systemWrapper, @Mocked TransactionBatchWrapper transactionBatchWrapper,
			@Mocked TransactionWrapper[] transactionWrapper, @Mocked TransactionWrapper transactionWrapper1, @Mocked TransactionInterface transactionInterface,
			@Mocked TransactionProxy transactionProxy, @Mocked IBACache ibaCache,
			@Mocked scb.util.SQLStatementObject sqlStatementObject, @Mocked scb.util.SQLStatementObject stmt,
			@Injectable scb.util.SQLResultObject rs, @Mocked SessionContext mySessionCtx ) throws SCBApplicationException {
		eodWrapper.threadName = "PostEngine";
		final Date dateParam = Date.valueOf("2022-02-01");
		final Object[] obj = new Object[] { "447", "0006", dateParam, "234567", "OTCH3" };
		transactionBatchWrapper.transactionWrapper = new TransactionWrapper[1];
		transactionBatchWrapper.transactionWrapper[0] = new TransactionWrapper();
		transactionBatchWrapper.transactionWrapper[0].originatorID = "OTCH3";
		transactionBatchWrapper.transactionWrapper[0].txnAttributeFlag ='0';
		transactionWrapper1.originatorID = "OTCS3";
		
		try {
			Deencapsulation.setField(postenginesessionbean, "intermediateTransactionEntityHome", intermediateTransactionEntityHome);
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			new Expectations() {
				{
					eodWrapper.getNextElement();
					returns(obj, null);
				};
				{
					intermediateTransactionEntityHome.findByPrimaryKey(new IntermediateTransactionEntityKey("447", "0006", dateParam, "234567"));
					result=intermediateTransactionEntity;
					intermediateTransactionEntity.getWrapper();
					returns(transactionBatchWrapper);
				};
				{
					staticDataCache.getSystemWrapper();
					result = systemWrapper;
				};
				{
					transactionWrapper1.clone();
					result = transactionWrapper1;
				};
				{
					stmt.executeUpdate();
					result = 1;
				};
				{
					rs.next();
					returns(true, true, false);
				};
				{
					rs.getString(anyInt);
					result = "Y";
				};
			};
		
		postenginesessionbean.reversalTransactions(eodWrapper);
		
		} catch (FinderException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
	
		//@Test
	public void testTransactionEventPublish2() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("Nexus");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "202101040127447";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			
			Object[] eventDataArray = new Object[21];
			//eventDataArray[20] = "ICDD";
			eventDataArray[19] = "12345|334|445|443|2022-12-12";//EVENTKEY
			eventDataArray[0] = "TRN_ONL_EVT_STORE";//Table Name
			eventDataArray[4] = "2022-12-12";
			eventDataArray[3] = "Nexus123";
			
			Map<String,List<Object[]>> eventConfigDataMap = new HashMap<>();
			List<Object[]> eventConfigDataList = new ArrayList<>();
			Object[] eventDataArray1 = new Object[21];
			eventDataArray[0] = "TRN_ONL_EVT_STORE";
			eventDataArray[1] = "123";
			eventDataArray[2] = "123";
			eventDataArray[3] = "123";
			eventDataArray[10]= 0;
			eventConfigDataList.add(eventDataArray1);
			eventConfigDataMap.put("Nexus",eventConfigDataList);
			Deencapsulation.setField(postenginesessionbean, "eventConfigDataMap", eventConfigDataMap);
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			try {
				new NonStrictExpectations() {
					{
						eodWrapper.getNextElement();
						returns(eventDataArray, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
						trnRs.next();
						returns (false,false);
						
						eventConfigDataMap.get("Nexus");
						result = eventConfigDataList;
						
						
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.transactionEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	
	//@Test
	public void testTransactionEventPublish3() {
		try {
			UserDetail userDetail = new UserDetail();
			userDetail.setUserID("Nexus");
			TransactionWrapper transactionWrapper1 = new TransactionWrapper();
			transactionWrapper1.alertStatus = '1';
			transactionWrapper1.approvedSeqNo = "123456789";
			transactionWrapper1.txnTime = new java.sql.Timestamp(1662978015070L);
			transactionWrapper1.makerDetails = userDetail;
			
			Object[] eventDataArray = new Object[21];
			eventDataArray[19] = "12345|334|445|443|2022-12-12";//EVENTKEY
			eventDataArray[0] = "TRN_ONL_EVT_STORE";//Table Name
			eventDataArray[4] = "2022-12-12";
			eventDataArray[3] = "ABCD1234";
			
			Map<String,List<Object[]>> eventConfigDataMap = new HashMap<>();
			List<Object[]> eventConfigDataList = new ArrayList<>();
			Object[] eventDataArray1 = new Object[21];
			eventDataArray[0] = "TRN_BAT_EVT_STORE";
			eventDataArray[1] = "123";
			eventDataArray[2] = "123";
			eventDataArray[3] = "123";
			eventDataArray[10]= 0;
			eventConfigDataList.add(eventDataArray1);
			eventConfigDataMap.put("Nexus",eventConfigDataList);
			Deencapsulation.setField(postenginesessionbean, "eventConfigDataMap", eventConfigDataMap);
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			try {
				new NonStrictExpectations() {
					{
						SystemProperties.getInstance().getServerVersion();
						result="JBOSS";
						eodWrapper.getNextElement();
						returns(eventDataArray, null);
						EventMessageWrapper mockEvtmsg = new EventMessageWrapper();
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						Deencapsulation.invoke(evtmsgGenerator, "generateEvent");
						result = mockEvtmsg;
						eventProcessorImpl.trigerOnlineTxnEvent((EventMessageWrapper)any);
						result = new Exception();
						trnRs.next();
						returns (false,false);
						
						eventConfigDataMap.get("Nexus");
						result = eventConfigDataList;
						
						mySessionCtx.getUserTransaction().commit();
						result = new Exception();
						
						mySessionCtx.getUserTransaction().rollback();
						result = new Exception();
					}
				};
			} catch (Exception e) {
				Assert.assertFalse(false);
			}
			EODWrapper eodWrapper1 = new EODWrapper();
			postenginesessionbean.transactionEventPublish(eodWrapper1);
			Assert.assertTrue(true);
		}  catch (Exception e) {
			Assert.assertTrue(true);
		}
	}
	//@Test
	public void testProcessLMTFMEARecords() throws Exception {
			try {
				
				new Expectations() {
					{
						Object[] nextObject = null;	
						nextObject[1] = "00201";
						nextObject[2] = "008";
						nextObject[3] = 2023-07-20;
						nextObject[4] = "12345678";
						nextObject[5] = "0001";
						nextObject[6] = "010203040506";
						nextObject[7] = "SGD";
						nextObject[8] = "D";
						nextObject[9] = 100;
						nextObject[10] = "UNIQ10";
						eodWrapper.getNextElement();
						returns(nextObject,null);
					};
					};
				postenginesessionbean.processLMTFMEARecords(eodWrapper);
			} catch (Exception exObj) {
				
			}
		}
		//@Test
	public void testProcessFrontEndTransaction(@Mocked StaticDataCache staticDataCache,@Injectable SessionContext sessionContext) throws Exception
	{	
		 VATCodeForChargeSetupWrapper VATwrapper=new VATCodeForChargeSetupWrapper();
		 ABHInterestBusinessParamWrapper abhInterestBusinessParamWrapper=new ABHInterestBusinessParamWrapper();
		 String[] batch= new String [] {"12345", "0029","1234"};	
		 TransactionBatchWrapper trnBatchWrapper=new TransactionBatchWrapper();
		trnBatchWrapper.makerDetail = new UserDetail();
		trnBatchWrapper.makerDetail.setUserBranch("02001");
		trnBatchWrapper.makerDetail.setUserDate(Date.valueOf("2021-01-02"));
		trnBatchWrapper.makerDetail.setUserID("SYSTEM");
		trnBatchWrapper.makerDetail.setUserIPAddress("00.00.00.00");
		trnBatchWrapper.makerDetail.setUserTime(new Time(111111));
		TransactionWrapper[] trnWrappers = new TransactionWrapper[1];
		 GeneralParamWrapper generalParamWrapper=new GeneralParamWrapper();
		generalParamWrapper.channelId="0029";
		 TransactionWrapper trnWrapper = new TransactionWrapper();
		trnWrapper.accountNo = "123456789";
		trnWrapper.currencyCode = "SGD";
		trnWrapper.financialTransactionFlag = 'Y';		trnWrapper.nonFinancialTransactionType = 'Y';
		trnWrapper.keyIdentifier="1234";	
		trnWrapper.channelID="0029";

		trnWrappers[0] = trnWrapper;

		trnBatchWrapper.transactionWrapper = trnWrappers;
		 SubsidiaryAccountWrapper subsidiaryAccountWrapper=new SubsidiaryAccountWrapper();

		Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
		Deencapsulation.setField(postenginesessionbean,"idGeneratorSession",idGeneratorSession);
		Deencapsulation.setField(postenginesessionbean,"subsidiaryAccountEntityHome",subsidiaryAccountEntityHome);
		Deencapsulation.setField(postenginesessionbean,"directDebitMandateEntityHome",directDebitMandateEntityHome);
		Deencapsulation.setField(postenginesessionbean,"transactionArchiveEntityHome",transactionArchiveEntityHome);
		Deencapsulation.setField(postenginesessionbean,"balanceQueueEntityHome",balanceQueueEntityHome);

		 InterestWrapper interestWrapper=new InterestWrapper();
		 DirectDebitMandateWrapper directDebitMandateWrapper=new DirectDebitMandateWrapper();
		directDebitMandateWrapper.childWrapper=new DirectDebitMandateChildWrapper[1];
		directDebitMandateWrapper.childWrapper[0]=new DirectDebitMandateChildWrapper();
		directDebitMandateWrapper.childWrapper[0].dCount=BigDecimal.ONE;
		directDebitMandateWrapper.childWrapper[0].accountValidatorFlag='N';
		directDebitMandateWrapper.childWrapper[0].frequencyType="D";
		directDebitMandateWrapper.childWrapper[0].makerDetail=new  UserDetail();
		directDebitMandateWrapper.setMakerDetails(new UserDetail());
		directDebitMandateWrapper.setCheckerDetails(new UserDetail());

		new NonStrictExpectations() {
			{
				businessProcessParamCache.getInstance().getProcessParameters("ISVATAPPLICABLE");result=VATwrapper;
				businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.ABH_INTEREST_PARAM);result=abhInterestBusinessParamWrapper;
				businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.CHNL);result=generalParamWrapper;
				eodWrapper.getNextElement();returns(batch,null);
				TPSDAOFactory.getDAOInstance("IntermediateTransactionEntity");result=intermediateTransactionEntityHome;
				intermediateTransactionEntityHome.findByPrimaryKeyForUpdate((IntermediateTransactionEntityKey)any);result=intermediateTransactionEntity;
				intermediateTransactionEntity.getWrapper();result=trnBatchWrapper;
				idGeneratorSession.generateDateBasedID("PEMainListner",trnBatchWrapper.makerDetail, 7);
				subsidiaryAccountEntityHome.findByPrimaryKey(new SubsidiaryAccountEntityKey(trnWrapper.currencyCode,trnWrapper.accountNo,null));result=subsidiaryAccountEntity;
				subsidiaryAccountEntity.getWrapper();result=subsidiaryAccountWrapper;
				interestCodeCacheForCapitalisation.fetchInterestCodeDetails(subsidiaryAccountWrapper.interestCode, trnWrapper.currencyCode);result=interestWrapper;
				directDebitMandateEntityHome.findByPrimaryKey((DirectDebitMandateEntityKey) any);result=directDebitMandateEntity;//new DirectDebitMandateEntityKey(anyString,anyString,anyString)
				directDebitMandateEntity.getWrapper();result=directDebitMandateWrapper;
			}
		};
		EODWrapper eodWrapper = new EODWrapper();
		postenginesessionbean.processFrontendTransactions(eodWrapper);		
	}	
	
	//@Test
	public void testProcessFrontEndTransactionException(@Mocked StaticDataCache staticDataCache,@Injectable SessionContext sessionContext) throws Exception
	{	
		 VATCodeForChargeSetupWrapper VATwrapper=new VATCodeForChargeSetupWrapper();
		 ABHInterestBusinessParamWrapper abhInterestBusinessParamWrapper=new ABHInterestBusinessParamWrapper();
		 GeneralParamWrapper generalParamWrapper=new GeneralParamWrapper();
		generalParamWrapper.channelId="0029";
		 String[] batch= new String [] {"12345", "0029","1234"};	
		 TransactionBatchWrapper trnBatchWrapper=new TransactionBatchWrapper();
		trnBatchWrapper.makerDetail = new UserDetail();
		trnBatchWrapper.makerDetail.setUserBranch("02001");
		trnBatchWrapper.makerDetail.setUserDate(Date.valueOf("2021-01-02"));
		trnBatchWrapper.makerDetail.setUserID("SYSTEM");
		trnBatchWrapper.makerDetail.setUserIPAddress("00.00.00.00");
		trnBatchWrapper.makerDetail.setUserTime(new Time(111111));
		TransactionWrapper[] trnWrappers = new TransactionWrapper[1];

		 TransactionWrapper trnWrapper = new TransactionWrapper();
		trnWrapper.accountNo = "123456789";
		trnWrapper.currencyCode = "SGD";
		trnWrapper.financialTransactionFlag = 'Y';
		trnWrapper.nonFinancialTransactionType = 'Y';
		trnWrapper.keyIdentifier="1234";	
		trnWrapper.channelID="0029";

		trnWrappers[0] = trnWrapper;

		trnBatchWrapper.transactionWrapper = trnWrappers;
		 SubsidiaryAccountWrapper subsidiaryAccountWrapper=new SubsidiaryAccountWrapper();

		Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
		Deencapsulation.setField(postenginesessionbean,"idGeneratorSession",idGeneratorSession);
		Deencapsulation.setField(postenginesessionbean,"subsidiaryAccountEntityHome",subsidiaryAccountEntityHome);
		Deencapsulation.setField(postenginesessionbean,"directDebitMandateEntityHome",directDebitMandateEntityHome);
		Deencapsulation.setField(postenginesessionbean,"transactionArchiveEntityHome",transactionArchiveEntityHome);
		Deencapsulation.setField(postenginesessionbean,"balanceQueueEntityHome",balanceQueueEntityHome);

		 InterestWrapper interestWrapper=new InterestWrapper();
		 DirectDebitMandateWrapper directDebitMandateWrapper=new DirectDebitMandateWrapper();
		directDebitMandateWrapper.childWrapper=new DirectDebitMandateChildWrapper[1];
		directDebitMandateWrapper.childWrapper[0]=new DirectDebitMandateChildWrapper();
		directDebitMandateWrapper.childWrapper[0].dCount=BigDecimal.ONE;
		directDebitMandateWrapper.childWrapper[0].accountValidatorFlag='N';
		directDebitMandateWrapper.childWrapper[0].frequencyType="D";
		directDebitMandateWrapper.childWrapper[0].makerDetail=new  UserDetail();
		directDebitMandateWrapper.setMakerDetails(new UserDetail());
		directDebitMandateWrapper.setCheckerDetails(new UserDetail());

		new NonStrictExpectations() {
			{
				businessProcessParamCache.getInstance().getProcessParameters("ISVATAPPLICABLE");result=VATwrapper;
				businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.ABH_INTEREST_PARAM);result=abhInterestBusinessParamWrapper;
				businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.CHNL);result=generalParamWrapper;
				eodWrapper.getNextElement();returns(batch,null);
				TPSDAOFactory.getDAOInstance("IntermediateTransactionEntity");result=intermediateTransactionEntityHome;
				intermediateTransactionEntityHome.findByPrimaryKeyForUpdate((IntermediateTransactionEntityKey)any);result=intermediateTransactionEntity;
				intermediateTransactionEntity.getWrapper();result=trnBatchWrapper;
				idGeneratorSession.generateDateBasedID("PEMainListner",trnBatchWrapper.makerDetail, 7);
				subsidiaryAccountEntityHome.findByPrimaryKey(new SubsidiaryAccountEntityKey(trnWrapper.currencyCode,trnWrapper.accountNo,null));result=subsidiaryAccountEntity;
				subsidiaryAccountEntity.getWrapper();result=subsidiaryAccountWrapper;
				interestCodeCacheForCapitalisation.fetchInterestCodeDetails(subsidiaryAccountWrapper.interestCode, trnWrapper.currencyCode);result=interestWrapper;
				directDebitMandateEntityHome.findByPrimaryKey((DirectDebitMandateEntityKey) any);returns(new Exception(),directDebitMandateEntity);//new DirectDebitMandateEntityKey(anyString,anyString,anyString)
				directDebitMandateEntityHome.findByDebitRefNumber(anyString);result=getVector();
				directDebitMandateEntity.getWrapper();result=directDebitMandateWrapper;
//				directDebitMandateEntityHome.findByPrimaryKey((DirectDebitMandateEntityKey) any);result=directDebitMandateEntity;//new DirectDebitMandateEntityKey(anyString,anyString,anyString)
			}
		};
		EODWrapper eodWrapper = new EODWrapper();
		postenginesessionbean.processFrontendTransactions(eodWrapper);		
	}
	 public Enumeration getVector(){
		Vector resultVector = new Vector();
		DirectDebitMandateEntityKey resultKey = null;
		resultKey =  new DirectDebitMandateEntityKey("123456", "MYR","56789");
		resultVector.addElement(resultKey);
		return resultVector.elements();
	} 
	 
		//@Test
		public void testProcessFrontEndTransactionExcep(@Mocked StaticDataCache staticDataCache,@Injectable SessionContext sessionContext) throws Exception
		{	
			 VATCodeForChargeSetupWrapper VATwrapper=new VATCodeForChargeSetupWrapper();
			 ABHInterestBusinessParamWrapper abhInterestBusinessParamWrapper=new ABHInterestBusinessParamWrapper();
			 String[] batch= new String [] {"12345", "0029","1234"};	
			 TransactionBatchWrapper trnBatchWrapper=new TransactionBatchWrapper();
			trnBatchWrapper.makerDetail = new UserDetail();
			trnBatchWrapper.makerDetail.setUserBranch("02001");
			trnBatchWrapper.makerDetail.setUserDate(Date.valueOf("2021-01-02"));
			trnBatchWrapper.makerDetail.setUserID("SYSTEM");
			trnBatchWrapper.makerDetail.setUserIPAddress("00.00.00.00");
			trnBatchWrapper.makerDetail.setUserTime(new Time(111111));
			TransactionWrapper[] trnWrappers = new TransactionWrapper[1];
			 GeneralParamWrapper generalParamWrapper=new GeneralParamWrapper();
			generalParamWrapper.channelId="0029";
			 TransactionWrapper trnWrapper = new TransactionWrapper();
			trnWrapper.accountNo = "123456789";
			trnWrapper.currencyCode = "SGD";
			trnWrapper.financialTransactionFlag = 'Y';		
			trnWrapper.nonFinancialTransactionType = 'Y';
			trnWrapper.keyIdentifier="1234";	
			trnWrapper.channelID="0029";

			trnWrappers[0] = trnWrapper;

			trnBatchWrapper.transactionWrapper = trnWrappers;
			 SubsidiaryAccountWrapper subsidiaryAccountWrapper=new SubsidiaryAccountWrapper();

			Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
			Deencapsulation.setField(postenginesessionbean,"idGeneratorSession",idGeneratorSession);
			Deencapsulation.setField(postenginesessionbean,"subsidiaryAccountEntityHome",subsidiaryAccountEntityHome);
			Deencapsulation.setField(postenginesessionbean,"directDebitMandateEntityHome",directDebitMandateEntityHome);
			Deencapsulation.setField(postenginesessionbean,"transactionArchiveEntityHome",transactionArchiveEntityHome);
			Deencapsulation.setField(postenginesessionbean,"balanceQueueEntityHome",balanceQueueEntityHome);

			 InterestWrapper interestWrapper=new InterestWrapper();
			 DirectDebitMandateWrapper directDebitMandateWrapper=new DirectDebitMandateWrapper();
			directDebitMandateWrapper.childWrapper=new DirectDebitMandateChildWrapper[1];
			directDebitMandateWrapper.childWrapper[0]=new DirectDebitMandateChildWrapper();
//			directDebitMandateWrapper.childWrapper[0].dCount=BigDecimal.ONE;
			directDebitMandateWrapper.childWrapper[0].accountValidatorFlag='N';
			directDebitMandateWrapper.childWrapper[0].frequencyType="D";
			directDebitMandateWrapper.childWrapper[0].makerDetail=new  UserDetail();
			directDebitMandateWrapper.setMakerDetails(new UserDetail());
			directDebitMandateWrapper.setCheckerDetails(new UserDetail());

			new NonStrictExpectations() {
				{
					businessProcessParamCache.getInstance().getProcessParameters("ISVATAPPLICABLE");result=VATwrapper;
					businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.ABH_INTEREST_PARAM);result=abhInterestBusinessParamWrapper;
					businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.CHNL);result=generalParamWrapper;
					eodWrapper.getNextElement();returns(batch,null);
					TPSDAOFactory.getDAOInstance("IntermediateTransactionEntity");result=intermediateTransactionEntityHome;
					intermediateTransactionEntityHome.findByPrimaryKeyForUpdate((IntermediateTransactionEntityKey)any);result=intermediateTransactionEntity;
					intermediateTransactionEntity.getWrapper();result=trnBatchWrapper;
					idGeneratorSession.generateDateBasedID("PEMainListner",trnBatchWrapper.makerDetail, 7);
					subsidiaryAccountEntityHome.findByPrimaryKey(new SubsidiaryAccountEntityKey(trnWrapper.currencyCode,trnWrapper.accountNo,null));result=subsidiaryAccountEntity;
					subsidiaryAccountEntity.getWrapper();result=subsidiaryAccountWrapper;
					interestCodeCacheForCapitalisation.fetchInterestCodeDetails(subsidiaryAccountWrapper.interestCode, trnWrapper.currencyCode);result=interestWrapper;
					directDebitMandateEntityHome.findByPrimaryKey((DirectDebitMandateEntityKey) any);result=directDebitMandateEntity;//new DirectDebitMandateEntityKey(anyString,anyString,anyString)
					directDebitMandateEntity.getWrapper();result=directDebitMandateWrapper;
				}
			};
			EODWrapper eodWrapper = new EODWrapper();
			postenginesessionbean.processFrontendTransactions(eodWrapper);		
		}

	//@Test
	public void testinvokeSIMigrationProcess() throws Exception
	{
		EODWrapper eodWrapper = new EODWrapper();
		postenginesessionbean.invokeSIMigrationProcess(eodWrapper);
	}



	//@Test(expected = SCBApplicationException.class)
	public void testinvokeSIMigrationProcess2() throws Exception
	{
		Object[] obj = new Object[2];
		obj[0] = "12345";
		obj[1] = "789877";
		new Expectations() {
			{eodWrapper.getNextElement();result = obj;};

		};
		EODWrapper eodWrapper = new EODWrapper();
		postenginesessionbean.invokeSIMigrationProcess(eodWrapper);
	}


	//@Test(expected = Exception.class)
	public void testinvokeSIMigrationProcess3() throws Exception
	{
		Object[] obj = new Object[2];
		obj[0] = "1234599";
		obj[1] = "78987788";
		new NonStrictExpectations() {
			{eodWrapper.getNextElement();result = obj;};
			{InstructionDAOFactory.getDAOInstance("InstructionEntity");result=insEntityHome;};
			{insEntityHome.findByPrimaryKey((InstructionEntityKey)any);result=insEntity;}
			{insEntity.getWrapper();result=insWrapper;}
			{ECAPSInstructionsDAOFactory.getDAOInstance("ECAPSInstructionsEntity");result=eCAPSInstructionsHome;};
			{eCAPSInstructionsHome.findByPrimaryKey((ECAPSInstructionsEntityKey)any);result=ECAPSInstructionsEntity;}
			{ECAPSInstructionsEntity.getWrapper();result=new ObjectNotFoundException();}

		};
		InstructionWrapper[] insWrappers = new InstructionWrapper[1];
		InstructionWrapper insWrap = new InstructionWrapper();

		insWrapper.instructionNo = "123";
		insWrappers[0] = insWrap;

		EODWrapper eodWrapper = new EODWrapper();
		postenginesessionbean.invokeSIMigrationProcess(eodWrapper);
	}


	//@Test(expected = Exception.class)
	public void testinvokeSIMigrationProcess4() throws Exception
	{
		Object[] obj = new Object[2];
		obj[0] = "12345";
		obj[1] = "78987788";
		new NonStrictExpectations() {
			{eodWrapper.getNextElement();result = obj;};
			{InstructionDAOFactory.getDAOInstance("InstructionEntity");result=insEntityHome;};
			{insEntityHome.findByPrimaryKey((InstructionEntityKey)any);result=insEntity;}
			{insEntity.getWrapper();result=insWrapper;}
			{ECAPSInstructionsDAOFactory.getDAOInstance("ECAPSInstructionsEntity");result=eCAPSInstructionsHome;};
			{eCAPSInstructionsHome.findByPrimaryKey((ECAPSInstructionsEntityKey)any);result=ECAPSInstructionsEntity;}
			{ECAPSInstructionsEntity.getWrapper();result=new FinderException();}

		};
		InstructionWrapper[] insWrappers = new InstructionWrapper[1];
		InstructionWrapper insWrap = new InstructionWrapper();

		insWrapper.instructionNo = "123";
		insWrappers[0] = insWrap;

		EODWrapper eodWrapper = new EODWrapper();
		postenginesessionbean.invokeSIMigrationProcess(eodWrapper);
	}
		
	//@Test
	public void testProcessSSARecordsToAddRisk() throws SCBApplicationException{
		eodWrapper.prevWorkingDate = Date.valueOf("2023-11-20");
		Object[] obj = new Object[2];
		obj[0] = "12345";
		obj[1] = "78987788";
		eodWrapper.data = obj;
		try{
		Deencapsulation.setField(postenginesessionbean,"idGeneratorSession",idGeneratorSession);
		new Expectations() {
			{eodWrapper.getNextElement();returns (obj,null);};
/*			{idGeneratorSession.generateDateBasedID("PEMainListner",eodWrapper.userDtl, 7); result = new BigDecimal(1000);}
*/		};
		postenginesessionbean.processSSARecordsToAddRisk(eodWrapper);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	//@Test
	public void testRemoveSSARiskEntries() throws SCBApplicationException {
		eodWrapper.prevWorkingDate = Date.valueOf("2023-11-20");
		Object[] obj = new Object[2];
		obj[0] = "12345";
		obj[1] = "78987788";
		eodWrapper.data = obj;
		RiskIndicatorWrapper riskIndicatorWrapper = new RiskIndicatorWrapper();
		try {
			/*new Expectations() {
				{
					eodWrapper.getNextElement();
					returns(obj, null);
				};
				{
					riskIndicatorEntityHome.findRiskForAccount(anyString, anyString, anyString);
					result = riskIndicatorWrapper;
				};
			};*/
			postenginesessionbean.removeSSARiskEntries(eodWrapper);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	
	//@Test
	public void counterstatisticalfieldsupdation_test() throws Exception {
		try {
			Deencapsulation.setField(postenginesessionbean,"excessSessionHome",excessSessionHome);
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			Deencapsulation.setField(postenginesessionbean,"subsidiaryAccountEntityHome",subsidiaryAccountEntityHome);
			Deencapsulation.setField(postenginesessionbean,"balanceQueueEntityHome",balanceQueueEntityHome);
			Deencapsulation.setField(postenginesessionbean,"accountsQueueEntityHome",accountsQueueEnityHome);
			Deencapsulation.setField(postenginesessionbean,"currentTransactionStatisticsEntityHome",currentTransactionStatisticsEntityHome);
			Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);
			Deencapsulation.setField(postenginesessionbean, "statisticalGroupEntityHome",statisticalGroupEntityHome);
			
			AbstractWrapper[] params = new AbstractWrapper[1];
			RelationshipBusinessParamWrapper relationshipBusinessParamWrapper= new RelationshipBusinessParamWrapper();
			params[0] = relationshipBusinessParamWrapper;
			
			AbstractWrapper[] params2 = new AbstractWrapper[1];
			AadharOTPBusinessParamWrapper aadharOTPBusinessParamWrapper = new AadharOTPBusinessParamWrapper();
			params2[0] = aadharOTPBusinessParamWrapper;
			
			AbstractWrapper[] params3 = new AbstractWrapper[1];
			AccountBusinessParamWrapper accountBusinessParamWrapper = new AccountBusinessParamWrapper();
			params3[0] = accountBusinessParamWrapper;
			
			AbstractWrapper[] params4 = new AbstractWrapper[1];
			InterestBusinessParamWrapper interestBusinessParamWrapper = new InterestBusinessParamWrapper();
			params4[0] = interestBusinessParamWrapper;
			
			AbstractWrapper[] params5 = new AbstractWrapper[1];
			AsiaMilesBusinessParamWrapper asiaMilesBusinessParamWrapper = new AsiaMilesBusinessParamWrapper();
			asiaMilesBusinessParamWrapper.asiaMilesRequired = 'N';
			params5[0] = asiaMilesBusinessParamWrapper;
			
			EODWrapper eodWrapper = new EODWrapper();
			eodWrapper.data = new Object[1];
			eodWrapper.eodDate = Date.valueOf("2020-01-01");
			Object[] obj = new Object[4];
			String[] arr = {"1","2","3","4","5","6","7"};
			Object[] trn = new Object[1];
			trn[0]=arr;
			
			obj[0]="0027";
			obj[1]="123121";
			obj[2] = trn;
			eodWrapper.data[0] = obj;

			SubsidiaryAccountWrapper accountWrapper = new SubsidiaryAccountWrapper();
			TransactionWrapper tWrapper = new TransactionWrapper();
			tWrapper.transactionCode="123";
			tWrapper.transactionAmount = new BigDecimal(1234);
			tWrapper.currencyCode="XXX";
			tWrapper.accountNo="12313131";
			
			String[] s={"111"};
			
			TransactionStatisticsWrapper transactionStatisticsWrapper = new TransactionStatisticsWrapper();
			transactionStatisticsWrapper.currencyCode="XXX";
			transactionStatisticsWrapper.accountNo="123131";
			
			StatisticalGroupWrapper statisticalGroupWrapper = new StatisticalGroupWrapper();
			statisticalGroupWrapper.specialProgramName = "scb.business.etransaction.ejb.ReagingStatisticalGroup";
			
			new NonStrictExpectations() {
				{
					Deencapsulation.invoke(log, "getInstance");
					result = log;
					EODTransactionsCache.getInstance((EODWrapper)any);
					result = eodTransactionsCache;
					BusinessProcessParamCache.getInstance().getProcessParameters(BusinessProcessConstants.REL_PARAM);
					result = params;
					BusinessInfo.getInstance();
					result = businessInfo;
					StaticDataCache.getInstance().getSystemWrapper();
					result = systemWrapper;
					BusinessProcessParamCache.getInstance().getProcessParameters(EBBSBusinessProcessConstants.AADHAROTP);
					result = params2;
					BusinessProcessParamCache.getInstance().getProcessParameters(BusinessProcessConstants.ACCOUNT_PARAM);
					result = params3;
					BusinessProcessParamCache.getInstance().getProcessParameters("MTDBAL");
					result = params4;
					eodWrapper.getNextElement();
					result = obj;
					subsidiaryAccountEntityBean.findByPrimaryKey((SubsidiaryAccountEntityKey)any);
					result=subsidiaryAccountEntity;
					subsidiaryAccountEntity.getWrapper();
					result=accountWrapper;
					balanceQueueEntityHome.findByPrimaryKey((BalanceQueueEntityKey)any);
					result=balanceQueueEntity;
					balanceQueueEntity.getWrapper();
					result=tWrapper;
					subsidiaryAccountEntityBean.fetchWrapper((PrimaryKey)any);
					result = accountWrapper; 
					currentTransactionStatisticsEntityHome.findByPrimaryKey((CurrentTransactionStatisticsEntityKey)any);
					result = currentTransactionStatisticsEntity;
					currentTransactionStatisticsEntity.getWrapper();
					result = transactionStatisticsWrapper;
					BusinessProcessParamCache.getInstance().getProcessParameters(EBBSBusinessProcessConstants.ASIA_MILES);
					result = params5;
					previousTransactionStatisticsEntityHome.findByPrimaryKeyForUpdate((PreviousTransactionStatisticsEntityKey)any);
					result = previousTransactionStatisticsEntity;
					previousTransactionStatisticsEntity.getWrapper();
					result=new TransactionStatisticsWrapper();
					EODTransactionsCache.getInstance((EODWrapper)any);
					result = eodTransactionsCache;
					eodTransactionsCache.getProgramBasedStatisticalGroupCode(anyString,anyString);
					result = s;
					currentTransactionStatisticsEntityHome.findByPrimaryKeyForUpdate((CurrentTransactionStatisticsEntityKey)any);
					result = new ObjectNotFoundException();
					statisticalGroupEntityHome.findByPrimaryKey((StatisticalGroupEntityKey)any);
					result = statisticalGroupEntity;
					statisticalGroupEntity.getWrapper();
					result = statisticalGroupWrapper;
					StaticDataCache.getInstance().fetchRelationshipNoForAccount(anyString, anyString, true);
					result = s;
				}
			};
			postenginesessionbean.counterStatisticalFieldsUpdation(eodWrapper);
			//Assert.assertTrue(true);
		} catch (Exception exObj) {
			//Assert.assertTrue(true);
		}
	}
	
	//@Test
	public void counterstatisticalfieldsupdation_test2() throws Exception {
		try {
			Deencapsulation.setField(postenginesessionbean,"excessSessionHome",excessSessionHome);
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			Deencapsulation.setField(postenginesessionbean,"subsidiaryAccountEntityHome",subsidiaryAccountEntityHome);
			Deencapsulation.setField(postenginesessionbean,"balanceQueueEntityHome",balanceQueueEntityHome);
			Deencapsulation.setField(postenginesessionbean,"accountsQueueEntityHome",accountsQueueEnityHome);
			Deencapsulation.setField(postenginesessionbean,"currentTransactionStatisticsEntityHome",currentTransactionStatisticsEntityHome);
			Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);
			Deencapsulation.setField(postenginesessionbean, "statisticalGroupEntityHome",statisticalGroupEntityHome);
			
			AbstractWrapper[] params = new AbstractWrapper[1];
			RelationshipBusinessParamWrapper relationshipBusinessParamWrapper= new RelationshipBusinessParamWrapper();
			params[0] = relationshipBusinessParamWrapper;
			
			AbstractWrapper[] params2 = new AbstractWrapper[1];
			AadharOTPBusinessParamWrapper aadharOTPBusinessParamWrapper = new AadharOTPBusinessParamWrapper();
			params2[0] = aadharOTPBusinessParamWrapper;
			
			AbstractWrapper[] params3 = new AbstractWrapper[1];
			AccountBusinessParamWrapper accountBusinessParamWrapper = new AccountBusinessParamWrapper();
			params3[0] = accountBusinessParamWrapper;
			
			AbstractWrapper[] params4 = new AbstractWrapper[1];
			InterestBusinessParamWrapper interestBusinessParamWrapper = new InterestBusinessParamWrapper();
			params4[0] = interestBusinessParamWrapper;
			
			AbstractWrapper[] params5 = new AbstractWrapper[1];
			AsiaMilesBusinessParamWrapper asiaMilesBusinessParamWrapper = new AsiaMilesBusinessParamWrapper();
			asiaMilesBusinessParamWrapper.asiaMilesRequired = 'N';
			params5[0] = asiaMilesBusinessParamWrapper;
			
			EODWrapper eodWrapper = new EODWrapper();
			eodWrapper.data = new Object[1];
			eodWrapper.eodDate = Date.valueOf("2020-01-01");
			Object[] obj = new Object[4];
			String[] arr = {"1","2","3","4","5","6","7"};
			Object[] trn = new Object[1];
			trn[0]=arr;
			
			obj[0]="0027";
			obj[1]="123121";
			obj[2] = trn;
			eodWrapper.data[0] = obj;

			SubsidiaryAccountWrapper accountWrapper = new SubsidiaryAccountWrapper();
			TransactionWrapper tWrapper = new TransactionWrapper();
			tWrapper.transactionCode="123";
			tWrapper.transactionAmount = new BigDecimal(1234);
			tWrapper.currencyCode="XXX";
			tWrapper.accountNo="12313131";
			
			String[] s={"111"};
			
			TransactionStatisticsWrapper transactionStatisticsWrapper = new TransactionStatisticsWrapper();
			transactionStatisticsWrapper.currencyCode="XXX";
			transactionStatisticsWrapper.accountNo="123131";
			
			StatisticalGroupWrapper statisticalGroupWrapper = new StatisticalGroupWrapper();
			statisticalGroupWrapper.specialProgramName = "scb.business.etransaction.ejb.ReagingStatisticalGroup";
			
			new NonStrictExpectations() {
				{
					Deencapsulation.invoke(log, "getInstance");
					result = log;
					EODTransactionsCache.getInstance((EODWrapper)any);
					result = eodTransactionsCache;
					BusinessProcessParamCache.getInstance().getProcessParameters(BusinessProcessConstants.REL_PARAM);
					result = params;
					BusinessInfo.getInstance();
					result = businessInfo;
					StaticDataCache.getInstance().getSystemWrapper();
					result = systemWrapper;
					BusinessProcessParamCache.getInstance().getProcessParameters(EBBSBusinessProcessConstants.AADHAROTP);
					result = params2;
					BusinessProcessParamCache.getInstance().getProcessParameters(BusinessProcessConstants.ACCOUNT_PARAM);
					result = params3;
					BusinessProcessParamCache.getInstance().getProcessParameters("MTDBAL");
					result = params4;
					eodWrapper.getNextElement();
					result = obj;
					subsidiaryAccountEntityBean.findByPrimaryKey((SubsidiaryAccountEntityKey)any);
					result=subsidiaryAccountEntity;
					subsidiaryAccountEntity.getWrapper();
					result=accountWrapper;
					balanceQueueEntityHome.findByPrimaryKey((BalanceQueueEntityKey)any);
					result=balanceQueueEntity;
					balanceQueueEntity.getWrapper();
					result=tWrapper;
					subsidiaryAccountEntityBean.fetchWrapper((PrimaryKey)any);
					result = accountWrapper; 
					currentTransactionStatisticsEntityHome.findByPrimaryKey((CurrentTransactionStatisticsEntityKey)any);
					result = currentTransactionStatisticsEntity;
					currentTransactionStatisticsEntity.getWrapper();
					result = transactionStatisticsWrapper;
					BusinessProcessParamCache.getInstance().getProcessParameters(EBBSBusinessProcessConstants.ASIA_MILES);
					result = params5;
					previousTransactionStatisticsEntityHome.findByPrimaryKeyForUpdate((PreviousTransactionStatisticsEntityKey)any);
					result = previousTransactionStatisticsEntity;
					previousTransactionStatisticsEntity.getWrapper();
					result=new TransactionStatisticsWrapper();
					EODTransactionsCache.getInstance((EODWrapper)any);
					result = eodTransactionsCache;
					eodTransactionsCache.getProgramBasedStatisticalGroupCode(anyString,anyString);
					result = s;
					currentTransactionStatisticsEntityHome.findByPrimaryKeyForUpdate((CurrentTransactionStatisticsEntityKey)any);
					result = new ObjectNotFoundException();
					statisticalGroupEntityHome.findByPrimaryKey((StatisticalGroupEntityKey)any);
					result = statisticalGroupEntity;
					statisticalGroupEntity.getWrapper();
					result = statisticalGroupWrapper;
					StaticDataCache.getInstance().fetchRelationshipNoForAccount(anyString, anyString, true);
					result = new Exception();
				}
			};
			postenginesessionbean.counterStatisticalFieldsUpdation(eodWrapper);
			//Assert.assertTrue(true);
		} catch (Exception exObj) {
			//Assert.assertTrue(true);
		}
	}
	
	//@Test(expected =  Exception.class)
	public void testUpdateCounterStatisticalFieldsResetNew() throws SCBApplicationException, FinderException {
		EODWrapper eodWrapper = new EODWrapper();
		eodWrapper.systemDate = Date.valueOf("2024-06-15");
		eodWrapper.prevWorkingDate = Date.valueOf("2024-06-14");
		eodWrapper.nextWorkingDate = Date.valueOf("2024-06-16");
		 eodWrapper.commitBlock=10;
		eodWrapper.data = new Object[10];
		
		
		
		Object o[] = new Object[100];
		o[0]="BHD";
		o[1]= "123123";
		o[2]="F01";
		o[3]="1";
		o[4]="1";
		o[5]=BigDecimal.ONE;
		o[6]=BigDecimal.ONE;
		o[7]="1";
		o[8]="1";
		o[9]=BigDecimal.ONE;
		o[10]=BigDecimal.ONE;
		o[11]="1";
		o[12]="1";
		o[13]=BigDecimal.ONE;
		o[14]=BigDecimal.ONE;
		o[15]="1";
		o[16]="1";
		o[17]=BigDecimal.ONE;
		o[18]=BigDecimal.ONE;
		o[19]="1";
		o[20]="1";
		o[21]=BigDecimal.ONE;
		o[22]=BigDecimal.ONE;
		o[23]="1";
		o[24]="1";
		o[25]=BigDecimal.ONE;
		o[26]=BigDecimal.ONE;
		o[27]=Date.valueOf("2024-06-15");
		o[28]=BigDecimal.ONE;
		o[29]=BigDecimal.ONE;
		o[30]=BigDecimal.ONE;
		o[31]=BigDecimal.ONE;
		o[32]=BigDecimal.ONE;
		o[33]=BigDecimal.ONE;
		o[34]=BigDecimal.ONE;
		o[35]=BigDecimal.ONE;
		o[36]=BigDecimal.ONE;
		o[37]=BigDecimal.ONE;
		o[38]=BigDecimal.ONE;
		o[39]=BigDecimal.ONE;
		o[40]="1";
		o[41]=BigDecimal.ONE;
		o[42]=BigDecimal.ONE;
		o[43]=BigDecimal.ONE;
		o[44]=BigDecimal.ONE;
		o[45]=Date.valueOf("2024-06-15");
		
		o[46]="1";
		
		o[47]="1";
		o[48]="1";
		o[49]=BigDecimal.ONE;
		o[50]=BigDecimal.ONE;
		
		o[51]="1";
		o[52]="1";
		o[53]=BigDecimal.ONE;
		o[54]=BigDecimal.ONE;
		
		o[55]="1";
		o[56]="1";
		o[57]=BigDecimal.ONE;
		o[58]=BigDecimal.ONE;
		
		o[59]="1";
		o[60]="1";
		o[61]=BigDecimal.ONE;
		o[62]=BigDecimal.ONE;
		
		o[63]="1";
		o[64]="1";
		o[65]=BigDecimal.ONE;
		o[66]=BigDecimal.ONE;
		
		o[67]=null;
		o[68]=Date.valueOf("2024-06-15");
		eodWrapper.data[0]=o;
		eodWrapper.data[1]=o;
		eodWrapper.data[2]=o;
		eodWrapper.data[3]=o;
		eodWrapper.data[4]=o;
		eodWrapper.data[5]=o;
		
		previousTransactionStatisticsEntityKey.accountNo="123123";
		previousTransactionStatisticsEntityKey.currencyCode="BHD";
		previousTransactionStatisticsEntityKey.statisticsGroupCode="F01";
		
		
		new NonStrictExpectations() { 
			{
				StaticDataCache.getInstance().getSystemWrapper();
				result = systemWrapper;
				eodWrapper.getNextElement();
				result=o;
				Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);
				previousTransactionStatisticsEntityHome.findByPrimaryKey(previousTransactionStatisticsEntityKey);
				result = previousTransactionStatisticsEntity;
				
				previousTransactionStatisticsEntity.getWrapper();
				result = previousTransactionStatisticsWrapper;
				Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
				
			}
		};
		
		postenginesessionbean.updateCounterStatisticalFieldsResetNew(eodWrapper);}
	
	
	//@Test(expected =  Exception.class)
	public void testUpdateCounterStatisticalFieldsResetNew2() throws SCBApplicationException, FinderException {
		EODWrapper eodWrapper = new EODWrapper();
		eodWrapper.systemDate = Date.valueOf("2024-06-15");
		eodWrapper.prevWorkingDate = Date.valueOf("2024-06-14");
		eodWrapper.nextWorkingDate = Date.valueOf("2024-06-16");
		 eodWrapper.commitBlock=10;
		eodWrapper.data = new Object[10];
		
		EODServiceParamWrapper param = new EODServiceParamWrapper();
		param.srvParamValue = "updateCalFields";
		eodWrapper.serviceParameters=new EODServiceParamWrapper[2];
		eodWrapper.serviceParameters[0]=param;
		
		Object o[] = new Object[100];
		o[0]="BHD";
		o[1]= "123123";
		o[2]="F01";
		o[3]="1";
		o[4]="1";
		o[5]=BigDecimal.ONE;
		o[6]=BigDecimal.ONE;
		o[7]="1";
		o[8]="1";
		o[9]=BigDecimal.ONE;
		o[10]=BigDecimal.ONE;
		o[11]="1";
		o[12]="1";
		o[13]=BigDecimal.ONE;
		o[14]=BigDecimal.ONE;
		o[15]="1";
		o[16]="1";
		o[17]=BigDecimal.ONE;
		o[18]=BigDecimal.ONE;
		o[19]="1";
		o[20]="1";
		o[21]=BigDecimal.ONE;
		o[22]=BigDecimal.ONE;
		o[23]="1";
		o[24]="1";
		o[25]=BigDecimal.ONE;
		o[26]=BigDecimal.ONE;
		o[27]=Date.valueOf("2024-06-15");
		o[28]=BigDecimal.ONE;
		o[29]=BigDecimal.ONE;
		o[30]=BigDecimal.ONE;
		o[31]=BigDecimal.ONE;
		o[32]=BigDecimal.ONE;
		o[33]=BigDecimal.ONE;
		o[34]=BigDecimal.ONE;
		o[35]=BigDecimal.ONE;
		o[36]=BigDecimal.ONE;
		o[37]=BigDecimal.ONE;
		o[38]=BigDecimal.ONE;
		o[39]=BigDecimal.ONE;
		o[40]="1";
		o[41]=BigDecimal.ONE;
		o[42]=BigDecimal.ONE;
		o[43]=BigDecimal.ONE;
		o[44]=BigDecimal.ONE;
		o[45]=Date.valueOf("2024-06-15");
		
		o[46]="1";
		
		o[47]="1";
		o[48]="1";
		o[49]=BigDecimal.ONE;
		o[50]=BigDecimal.ONE;
		
		o[51]="1";
		o[52]="1";
		o[53]=BigDecimal.ONE;
		o[54]=BigDecimal.ONE;
		
		o[55]="1";
		o[56]="1";
		o[57]=BigDecimal.ONE;
		o[58]=BigDecimal.ONE;
		
		o[59]="1";
		o[60]="1";
		o[61]=BigDecimal.ONE;
		o[62]=BigDecimal.ONE;
		
		o[63]="1";
		o[64]="1";
		o[65]=BigDecimal.ONE;
		o[66]=BigDecimal.ONE;
		
		o[67]=Date.valueOf("2024-06-15");
		o[68]=Date.valueOf("2024-06-15");
		eodWrapper.data[0]=o;
		eodWrapper.data[1]=o;
		eodWrapper.data[2]=o;
		eodWrapper.data[3]=o;
		eodWrapper.data[4]=o;
		eodWrapper.data[5]=o;
		
		previousTransactionStatisticsEntityKey.accountNo="123123";
		previousTransactionStatisticsEntityKey.currencyCode="BHD";
		previousTransactionStatisticsEntityKey.statisticsGroupCode="F01";
		
		
		new NonStrictExpectations() { 
			{
				StaticDataCache.getInstance().getSystemWrapper();
				result = systemWrapper;
				eodWrapper.getNextElement();
				result=o;
//				new PreviousTransactionStatisticsEntityKey(anyString, anyString, anyString);
//				returns(previousTransactionStatisticsEntityKey);
				Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);
				previousTransactionStatisticsEntityHome.findByPrimaryKey(previousTransactionStatisticsEntityKey);
				result = previousTransactionStatisticsEntity;
				
				previousTransactionStatisticsEntity.getWrapper();
				result = previousTransactionStatisticsWrapper;
				Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
				
			}
		};
		
		postenginesessionbean.updateCounterStatisticalFieldsResetNew(eodWrapper);}
	
	//@Test(expected =  Exception.class)
	public void testUpdateCounterStatisticalFieldsResetNew3() throws SCBApplicationException, FinderException {
		EODWrapper eodWrapper = new EODWrapper();
		eodWrapper.systemDate = Date.valueOf("2024-06-15");
		eodWrapper.prevWorkingDate = Date.valueOf("2024-06-14");
		eodWrapper.nextWorkingDate = Date.valueOf("2024-06-16");
		 eodWrapper.commitBlock=10;
		eodWrapper.data = new Object[10];
		
		EODServiceParamWrapper param = new EODServiceParamWrapper();
		param.srvParamValue = "updateCalFields";
		eodWrapper.serviceParameters=new EODServiceParamWrapper[2];
		eodWrapper.serviceParameters[0]=param;
		
		Object o[] = new Object[100];
		o[0]="BHD";
		o[1]= "123123";
		o[2]="F01";
		o[3]="1";
		o[4]="1";
		o[5]=BigDecimal.ONE;
		o[6]=BigDecimal.ONE;
		o[7]="1";
		o[8]="1";
		o[9]=BigDecimal.ONE;
		o[10]=BigDecimal.ONE;
		o[11]="1";
		o[12]="1";
		o[13]=BigDecimal.ONE;
		o[14]=BigDecimal.ONE;
		o[15]="1";
		o[16]="1";
		o[17]=BigDecimal.ONE;
		o[18]=BigDecimal.ONE;
		o[19]="1";
		o[20]="1";
		o[21]=BigDecimal.ONE;
		o[22]=BigDecimal.ONE;
		o[23]="1";
		o[24]="1";
		o[25]=BigDecimal.ONE;
		o[26]=BigDecimal.ONE;
		o[27]=Date.valueOf("2024-06-15");
		o[28]=BigDecimal.ONE;
		o[29]=BigDecimal.ONE;
		o[30]=BigDecimal.ONE;
		o[31]=BigDecimal.ONE;
		o[32]=BigDecimal.ONE;
		o[33]=BigDecimal.ONE;
		o[34]=BigDecimal.ONE;
		o[35]=BigDecimal.ONE;
		o[36]=BigDecimal.ONE;
		o[37]=BigDecimal.ONE;
		o[38]=BigDecimal.ONE;
		o[39]=BigDecimal.ONE;
		o[40]="1";
		o[41]=BigDecimal.ONE;
		o[42]=BigDecimal.ONE;
		o[43]=BigDecimal.ONE;
		o[44]=BigDecimal.ONE;
		o[45]=Date.valueOf("2024-06-15");
		
		o[46]="1";
		
		o[47]="1";
		o[48]="1";
		o[49]=BigDecimal.ONE;
		o[50]=BigDecimal.ONE;
		
		o[51]="1";
		o[52]="1";
		o[53]=BigDecimal.ONE;
		o[54]=BigDecimal.ONE;
		
		o[55]="1";
		o[56]="1";
		o[57]=BigDecimal.ONE;
		o[58]=BigDecimal.ONE;
		
		o[59]="1";
		o[60]="1";
		o[61]=BigDecimal.ONE;
		o[62]=BigDecimal.ONE;
		
		o[63]="1";
		o[64]="1";
		o[65]=BigDecimal.ONE;
		o[66]=BigDecimal.ONE;
		
		o[67]=null;
		o[68]=Date.valueOf("2024-06-15");
		eodWrapper.data[0]=o;
		eodWrapper.data[1]=o;
		eodWrapper.data[2]=o;
		eodWrapper.data[3]=o;
		eodWrapper.data[4]=o;
		eodWrapper.data[5]=o;
		
		previousTransactionStatisticsEntityKey.accountNo="123123";
		previousTransactionStatisticsEntityKey.currencyCode="BHD";
		previousTransactionStatisticsEntityKey.statisticsGroupCode="F01";
		
		
		new NonStrictExpectations() { 
			{
				StaticDataCache.getInstance().getSystemWrapper();
				result = systemWrapper;
				eodWrapper.getNextElement();
				result=o;
				Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);
				previousTransactionStatisticsEntityHome.findByPrimaryKey(previousTransactionStatisticsEntityKey);
				result = previousTransactionStatisticsEntity;
				
				previousTransactionStatisticsEntity.getWrapper();
				result = previousTransactionStatisticsWrapper;
				Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
				
			}
		};
		
		postenginesessionbean.updateCounterStatisticalFieldsResetNew(eodWrapper);}




//@Test(expected =  Exception.class)
public void testUpdateCounterStatisticalFieldsResetNew4() throws SCBApplicationException, FinderException {EODWrapper eodWrapper = new EODWrapper();
eodWrapper.systemDate = Date.valueOf("2024-06-15");
eodWrapper.prevWorkingDate = Date.valueOf("2024-06-14");
eodWrapper.nextWorkingDate = Date.valueOf("2024-06-16");
 eodWrapper.commitBlock=10;
eodWrapper.data = new Object[10];
Object o[] = new Object[100];
o[0]="BHD";
o[1]= "123123";
o[2]="F01";
o[3]="1";
o[4]="1";
o[5]=BigDecimal.ONE;
o[6]=BigDecimal.ONE;
o[7]="1";
o[8]="1";
o[9]=BigDecimal.ONE;
o[10]=BigDecimal.ONE;
o[11]="1";
o[12]="1";
o[13]=BigDecimal.ONE;
o[14]=BigDecimal.ONE;
o[15]="1";
o[16]="1";
o[17]=BigDecimal.ONE;
o[18]=BigDecimal.ONE;
o[19]="1";
o[20]="1";
o[21]=BigDecimal.ONE;
o[22]=BigDecimal.ONE;
o[23]="1";
o[24]="1";
o[25]=BigDecimal.ONE;
o[26]=BigDecimal.ONE;
o[27]=Date.valueOf("2024-06-15");
o[28]=BigDecimal.ONE;
o[29]=BigDecimal.ONE;
o[30]=BigDecimal.ONE;
o[31]=BigDecimal.ONE;
o[32]=BigDecimal.ONE;
o[33]=BigDecimal.ONE;
o[34]=BigDecimal.ONE;
o[35]=BigDecimal.ONE;
o[36]=BigDecimal.ONE;
o[37]=BigDecimal.ONE;
o[38]=BigDecimal.ONE;
o[39]=BigDecimal.ONE;
o[40]="1";
o[41]=BigDecimal.ONE;
o[42]=BigDecimal.ONE;
o[43]=BigDecimal.ONE;
o[44]=BigDecimal.ONE;
o[45]=Date.valueOf("2024-06-15");

o[46]="1";

o[47]="1";
o[48]="1";
o[49]=BigDecimal.ONE;
o[50]=BigDecimal.ONE;

o[51]="1";
o[52]="1";
o[53]=BigDecimal.ONE;
o[54]=BigDecimal.ONE;

o[55]="1";
o[56]="1";
o[57]=BigDecimal.ONE;
o[58]=BigDecimal.ONE;

o[59]="1";
o[60]="1";
o[61]=BigDecimal.ONE;
o[62]=BigDecimal.ONE;

o[63]="1";
o[64]="1";
o[65]=BigDecimal.ONE;
o[66]=BigDecimal.ONE;

o[67]=Date.valueOf("2024-06-15");
o[68]=Date.valueOf("2024-06-15");
eodWrapper.data[0]=o;
eodWrapper.data[1]=o;
eodWrapper.data[2]=o;
eodWrapper.data[3]=o;
eodWrapper.data[4]=o;
eodWrapper.data[5]=o;

previousTransactionStatisticsEntityKey.accountNo="123123";
previousTransactionStatisticsEntityKey.currencyCode="BHD";
previousTransactionStatisticsEntityKey.statisticsGroupCode="F01";


new NonStrictExpectations() { 
	{
		StaticDataCache.getInstance().getSystemWrapper();
		result = systemWrapper;
		eodWrapper.getNextElement();
		result=o;
		Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);
		previousTransactionStatisticsEntityHome.findByPrimaryKey(previousTransactionStatisticsEntityKey);
		result = previousTransactionStatisticsEntity;
		
		previousTransactionStatisticsEntity.getWrapper();
		result = previousTransactionStatisticsWrapper;
		Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
		
	}
};

postenginesessionbean.updateCounterStatisticalFieldsResetNew(eodWrapper);}

/*@Test public void testProcessLevyConfirmation() throws Exception{
	final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
	GeneralParamWrapper paramWrap = new GeneralParamWrapper();
	paramWrap.levyTopic = "C";
	paramWrap.levyTopicReq = "Y";
	paramWrap.levyConnFactory="B";
	abstractWrappers[0] = paramWrap;
	
	MessageWrapper messageWrapper= new MessageWrapper();
	new NonStrictExpectations() {

		{BusinessProcessParamCache.getInstance(); result = businessProcessParamCache;}
		{businessProcessParamCache.getProcessParameters("LEVYSOLACESETUP"); result = abstractWrappers;}
		{LevyDAOFactory.getDAOInstance("LevyEntity"); result=levyEntityHome;}
		{eodWrapper.getNextElement(); returns(new Object[] { "branch1", "channel1", new java.sql.Date(3), "008732" ,"asdf", true});}
		{messageSenderSession.sendMessage(messageWrapper); result= resMessage;}
	};
	postenginesessionbean.processLevyConfirmation(eodWrapper);
	
}*/
/*
@Test public void testProcessLevyConfirmation_else() throws Exception{
	final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
	GeneralParamWrapper paramWrap = new GeneralParamWrapper();
	paramWrap.levyTopic = "C";
	paramWrap.levyTopicReq = "N";
	paramWrap.levyConnFactory="B";
	abstractWrappers[0] = paramWrap;
	
	MessageWrapper messageWrapper= new MessageWrapper();
	new NonStrictExpectations() {

		{BusinessProcessParamCache.getInstance(); result = businessProcessParamCache;}
		{businessProcessParamCache.getProcessParameters("LEVYSOLACESETUP"); result = abstractWrappers;}
		{LevyDAOFactory.getDAOInstance("LevyEntity"); result=levyEntityHome;}
		{eodWrapper.getNextElement(); returns(new Object[] { "branch1", "channel1", new java.sql.Date(3), "008732" ,"asdf", true});}
		{messageSenderSession.sendMessage(messageWrapper); result= resMessage;}
	};
	postenginesessionbean.processLevyConfirmation(eodWrapper);
	
}*/
/*
@Test public void testprocessLevyRefundService () throws Exception{
	
	final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
	LevyBusinessParamWrapper paramWrap = new LevyBusinessParamWrapper();
	paramWrap.levyCode="ELY";
	paramWrap.debitTrnCode="123";
	abstractWrappers[0] = paramWrap;
	levyWrapper.levyBaseAmount=new BigDecimal(1000);
	levyWrapper.levySysTaxableAmt= BigDecimal.ONE;
	levyWrapper.levyPercent=BigDecimal.TEN;
	
	TransactionBatchWrapper transactionBatchWrapper= new TransactionBatchWrapper();
	TransactionWrapper[] txnWrapperArray = new TransactionWrapper[2];
	TransactionWrapper txnWrapper = new TransactionWrapper();
	TransactionWrapper txnWrapper2 = new TransactionWrapper();
	txnWrapper.reversalFlag='N';
	txnWrapper.transactionCode="123";
	txnWrapper2.reversalFlag='N';
	txnWrapper2.transactionCode="123";
	txnWrapperArray[0]=txnWrapper;
	txnWrapperArray[1]=txnWrapper2;
	transactionBatchWrapper.transactionWrapper=txnWrapperArray;
	
	
	new NonStrictExpectations() {
		{LevyDAOFactory.getDAOInstance("LevyEntity"); result=levyEntityHome;}
		{eodWrapper.getNextElement(); returns(new Object[] { "branch1", "channel1", new java.sql.Date(3), "008732" ,"asdf", true,"008732" ,"asdf","008732" ,"asdf","ELY" ,"ELY"});}
		{levyEntityHome.findByPrimaryKey((LevyEntityKey)any); result=levyEntity;}
		{levyEntity.getWrapper(); result= levyWrapper;}
		{intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey)any); result=intermediateTransactionEntity;}
		{intermediateTransactionEntity.getWrapper(); result=transactionBatchWrapper;}
		{BusinessProcessParamCache.getInstance(); result = businessProcessParamCache;}
		{businessProcessParamCache.getProcessParameters("LEVY"); result = abstractWrappers;}
	};
	Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
	postenginesessionbean.processLevyRefundService(eodWrapper);
}
*/

//@Test 
public void testprocessLevyRefundReversal(@Mocked TransactionBusinessLocalSession transactionBusinessLocalSession,
		@Mocked TransactionProcessingMonitor tpm) throws Exception{

	TransactionBatchWrapper transactionBatchWrapper= new TransactionBatchWrapper();
	transactionBatchWrapper.batchStatus=57;
	
	new NonStrictExpectations() {
		{LevyDAOFactory.getDAOInstance("LevyEntity"); result=levyEntityHome;}
		{eodWrapper.getNextElement(); returns(new Object[] { "branch1", "channel1", new java.sql.Date(3),"0087", "008732" ,"asdf", "qwert" ,"anything",new java.sql.Date(5) ,"008732" ,"asdf","ELY" ,"ELY"});}
		{transactionBusinessLocalSession.constructReversalBatchV1(anyString,anyString, new java.sql.Date(3), anyString); result=transactionBatchWrapper;}
		{mySessionCtx.getUserTransaction().begin();}
		{tpm.postReversalBatch(transactionBatchWrapper); result=transactionBatchWrapper;}
		{levyEntityHome.findByPrimaryKeyForUpdate((LevyEntityKey)any); result=levyEntity;}
		
	};
	Deencapsulation.setField(postenginesessionbean,"tpm",tpm);
	Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
	Deencapsulation.setField(postenginesessionbean,"transactionBusinessLocalSession",transactionBusinessLocalSession);
	postenginesessionbean.processLevyRefundReversal(eodWrapper);
}

//@Test 
public void testfetchReceiverAccountNo() throws Exception {
	TransactionBatchWrapper transactionBatchWrapper= new TransactionBatchWrapper();
	TransactionWrapper[] txnWrapperArray = new TransactionWrapper[1];
	TransactionWrapper txnWrapper = new TransactionWrapper();

	txnWrapper.creditOrDebitFlag='C';
	txnWrapper.sysGeneratedFlag='N';
	txnWrapper.seqNo="123";
	txnWrapperArray[0]=txnWrapper;

	transactionBatchWrapper.transactionWrapper=txnWrapperArray;
	
    new Expectations() {
		{intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey)any); result=intermediateTransactionEntity;}
		{intermediateTransactionEntity.getWrapper(); result=transactionBatchWrapper;}
    };
    Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
    Deencapsulation.invoke(postenginesessionbean, "fetchReceiverAccountNo", levyWrapper);
}


//@Test 
public void testvalidateSourceSystem() throws Exception {

	TransactionWrapper txnWrapper = new TransactionWrapper();

    Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
    Deencapsulation.invoke(postenginesessionbean, "validateSourceSystem", levyTrnMapBPPWrapper,txnWrapper);
}

//@Test 
public void testLoadBPPForLevyTrnMap() throws Exception {
	final AbstractWrapper[] abstractWrapperss = new AbstractWrapper[1];
	LevyTrnMapBusinessParamWrapper paramWraps = new LevyTrnMapBusinessParamWrapper();
	paramWraps.channelID="123456";
	paramWraps.transactionCode="1111";
	abstractWrapperss[0] = paramWraps;
	
	new NonStrictExpectations() {
		{BusinessProcessParamCache.getInstance(); result = businessProcessParamCache;}
		{businessProcessParamCache.getProcessParameters("LEVYTRNMAP"); result = abstractWrapperss;}
	};

    Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
    Deencapsulation.invoke(postenginesessionbean, "loadBPPForLevyTrnMap");
}

//@Test
public void testloadValuesForLevyTrnMapping() throws Exception {

	final AbstractWrapper[] abstractWrapperss = new AbstractWrapper[1];
	LevyTrnMapBusinessParamWrapper paramWraps = new LevyTrnMapBusinessParamWrapper();
	paramWraps.channelID="123456";
	paramWraps.transactionCode="1111";
	paramWraps.elevyAmount="3";
	paramWraps.transferTransactionID="900";
	paramWraps.transferTransactionTimestamp="LEVYTIMESTAMP";
	paramWraps.serviceType="LEVYTIMESTAMP";
	paramWraps.receiverAccountNumber="900";
	paramWraps.transferAmount="LEVYTIMESTAMP";
	paramWraps.clientTimestamp="LEVYTIMESTAMP";
	paramWraps.clientTransactionID="43453";
	paramWraps.isTxnamtFromTxnorLevy="T";
	abstractWrapperss[0] = paramWraps;
	
	final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
	LevyBusinessParamWrapper paramWrap = new LevyBusinessParamWrapper();
	paramWrap.levyCode="123456";
	paramWrap.docTypeValue="Anything";
	abstractWrappers[0] = paramWrap;
	
	TransactionBatchWrapper transactionBatchWrapper= new TransactionBatchWrapper();
	TransactionWrapper[] txnWrapperArray = new TransactionWrapper[1];
	TransactionWrapper txnWrapper = new TransactionWrapper();

	txnWrapper.creditOrDebitFlag='C';
	txnWrapper.sysGeneratedFlag='N';
	txnWrapper.seqNo="123";
	txnWrapper.channelID="00001";
	txnWrapper.batchEntryDate=Date.valueOf("2024-06-15");
	txnWrapper.transactionCode="123";
	txnWrapper.intAccountEntryFlag='N';
	txnWrapper.approvedSeqNo="123";
	txnWrapper.currencyCode="PKR";
	txnWrapper.accountNo="890786756456";
	txnWrapperArray[0]=txnWrapper;
	
	transactionBatchWrapper.transactionWrapper=txnWrapperArray;
	
	ConcurrentHashMap<String, LevyTrnMapBusinessParamWrapper> levyTrnConcurrHashMap = new ConcurrentHashMap();
	levyTrnConcurrHashMap.put("123456", paramWraps);
	levyTrnConcurrHashMap.put("00001123", paramWraps);
	
	LevyWrapper levyWrapper= new LevyWrapper();
	levyWrapper.seqNo="123";
	levyWrapper.currencyCode="PKR";
	levyWrapper.receiverAccountNo="2131241";
	SubsidiaryAccountWrapper subsidiaryAccountWrapper=new SubsidiaryAccountWrapper();
	subsidiaryAccountWrapper.masterNo="123445";
	subsidiaryAccountWrapper.accountBranch="000";
	AccountMasterWrapper masterWrapper = new AccountMasterWrapper();
	BranchWrapper branchWrapper = new BranchWrapper();
	
	new NonStrictExpectations() {
		{BusinessProcessParamCache.getInstance(); result = businessProcessParamCache;}
		{businessProcessParamCache.getProcessParameters("LEVYTRNMAP"); result = abstractWrapperss;}
		{businessProcessParamCache.getProcessParameters("LEVY"); result = abstractWrappers;}
		{intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey)any); result=intermediateTransactionEntity;}
		{intermediateTransactionEntity.getWrapper(); result=transactionBatchWrapper;}
		{subsidiaryAccountEntityHome.findByPrimaryKey((SubsidiaryAccountEntityKey)any); result=subsidiaryAccountEntity;}
		{subsidiaryAccountEntity.getWrapper(); result=subsidiaryAccountWrapper;}
		{accountMasterEntityHome.findByPrimaryKey((AccountMasterEntityKey)any); result=masterEntity;}
		{masterEntity.getPrimaryRelationship(); result="8989";}
		{branchEntityHome.findByPrimaryKey(new BranchEntityKey(subsidiaryAccountWrapper.accountBranch)); result=branchEntity;}
		{branchEntity.getWrapper(); result=branchWrapper;}
	};

	Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
	Deencapsulation.setField(postenginesessionbean,"accountMasterEntityHome",accountMasterEntityHome);
	Deencapsulation.setField(postenginesessionbean,"subsidiaryAccountEntityHome",subsidiaryAccountEntityHome);
	Deencapsulation.setField(postenginesessionbean,"branchEntityHome",branchEntityHome);
	Deencapsulation.setField(postenginesessionbean,"levyTrnConcurrHashMap",levyTrnConcurrHashMap);
    Deencapsulation.invoke(postenginesessionbean, "loadValuesForLevyTrnMapping", levyWrapper,false);
}
@Test
public void testprocessFebalFMEARecords() {
	
	try {
		eodWrapper=new EODWrapper();
	
		Object[] nextObject = new Object[10];

		nextObject[0] = (Object)"0099";
		nextObject[1]  = "0013";
		nextObject[2]  =Date.valueOf("2024-01-31");
		nextObject[3]  = "714567";
		nextObject[4]  = "202401310001";
		nextObject[5]  = "12345677889";
		nextObject[6]  = "USD";
		nextObject[7]  = (char) 'D';
		nextObject[8]  = new BigDecimal(10);
		nextObject[9]  = "efrevr";
	
		
		new Expectations() {
			
			{
			eodWrapper.getNextElement();result =nextObject ;result=null;
			};
			{
				LogWriter.getInstance("PostEngineSessionBean", "processFebalFMEARecords");
				result = log;
			};

			{
				intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey)any); result=intermediateTransactionEntity;
			};	
			{
				
			};
		};
		Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
	    Deencapsulation.invoke(postenginesessionbean, "processFebalFMEARecords", eodWrapper);
	} catch (Exception e) {
		e.printStackTrace();
	}

}
@Test
public void testprocessFebalFMEARecordsCredit() {
	
	try {
		eodWrapper=new EODWrapper();
	
		Object[] nextObject = new Object[10];

		nextObject[0] = (Object)"0099";
		nextObject[1]  = "0013";
		nextObject[2]  =Date.valueOf("2024-01-31");
		nextObject[3]  = "714567";
		nextObject[4]  = "202401310001";
		nextObject[5]  = "12345677889";
		nextObject[6]  = "USD";
		nextObject[7]  = (char) 'C';
		nextObject[8]  = new BigDecimal(10);
		nextObject[9]  = "efrevr";
	
		
		new Expectations() {
			
			{
			eodWrapper.getNextElement();result =nextObject ;result=null;
			};
			{
				LogWriter.getInstance("PostEngineSessionBean", "processFebalFMEARecords");
				result = log;
			};

			{
				intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey)any); result=intermediateTransactionEntity;
			};	
			{
				
			};
		};
		Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
	    Deencapsulation.invoke(postenginesessionbean, "processFebalFMEARecords", eodWrapper);
	} catch (Exception e) {
		e.printStackTrace();
	}

}
@Test
public void testprocessFebalFMEARecordsException() {
	
	try {
		eodWrapper=new EODWrapper();
	
		Object[] nextObject = null;
	
		new Expectations() {
			
			{
			eodWrapper.getNextElement();result =new ObjectNotFoundException();
			};
			{
				LogWriter.getInstance("PostEngineSessionBean", "processFebalFMEARecords");
				result = log;
			};

			{
				intermediateTransactionEntityHome.findByPrimaryKey((IntermediateTransactionEntityKey)any); result=intermediateTransactionEntity;
			};

			{
				
			};
		};
		Deencapsulation.setField(postenginesessionbean,"intermediateTransactionEntityHome",intermediateTransactionEntityHome);
	    Deencapsulation.invoke(postenginesessionbean, "processFebalFMEARecords", eodWrapper);
	} catch (Exception e) {
		e.printStackTrace();
	}

}
	@Test
	public void testProcessPostAccountCreationAction(
			@Mocked StaticDataCache staticDataCache, @Mocked SystemProperties sysProperties) throws Exception {
		
		final Object[] nextElemObj = { "12345", "INR", "C" };
		
		try {
			reqInfo = new RequestInfo();
			SubsidiaryAccountWrapper subsidiaryAccountWrapper = new SubsidiaryAccountWrapper();
			subsidiaryAccountWrapper.productCode = "308";
			subsidiaryAccountWrapper.setRequestInfo(reqInfo);

			productWrapper = new ProductWrapper();
			productWrapper.passbookReqFlag = 'Y';

			MasterRelationshipWrapper masterRelationshipWrapper[] = new MasterRelationshipWrapper[1];
			MasterRelationshipWrapper masterRelationshipWrapp = new MasterRelationshipWrapper();
			masterRelationshipWrapp.relationshipNumber = "01506947501";
			masterRelationshipWrapp.primaryAccount = 'Y';
			masterRelationshipWrapp.disableRelOperatingInstuctionFlag = false;
			masterRelationshipWrapper[0] = masterRelationshipWrapp;
			accountMasterWrapper.masterRelationshipWrapper = masterRelationshipWrapper;

			final AbstractWrapper[] abstractWrappers = new AbstractWrapper[1];
			relStatusParamWrapper = new RelationshipStatusUpdateParamWrapper();
			relStatusParamWrapper.setIsEventEnabled("N");

			AccountBusinessParamWrapper accountBusinessParamWrapper = new AccountBusinessParamWrapper();
			accountBusinessParamWrapper.setadviceRequired("N");			

			abstractWrappers[0] = relStatusParamWrapper;
			abstractWrappers[0] = accountBusinessParamWrapper;			
			
			gbaAbstractWrapper = new AbstractWrapper[1];
			gbaBppWarpper = new GBABusinessParamWrapper();
			gbaAbstractWrapper[0] = gbaBppWarpper;
			
			mcaAbstractWrapper = new AbstractWrapper[1];
			mcaBusinessParamWrapper = new MCABusinessParamWrapper();
			mcaAbstractWrapper[0] = mcaBusinessParamWrapper;

			systemWrapper = new SystemWrapper();
			systemWrapper.systemDate = Date.valueOf("2023-02-03");
			
			icmUtil.isICMEnabled = false;

			Deencapsulation.setField(postenginesessionbean, "productEntityHome", productEntityHome);
			Deencapsulation.setField(postenginesessionbean, "accountMasterEntityHome", accountMasterEntityHome);
			Deencapsulation.setField(postenginesessionbean, "mySessionCtx", mySessionCtx);
			Deencapsulation.setField(postenginesessionbean, "sysProperties", sysProperties);
			Deencapsulation.setField(postenginesessionbean, "currentTransactionStatisticsEntityHome", currentTransactionStatisticsEntityHome);
			Deencapsulation.setField(postenginesessionbean, "previousTransactionStatisticsEntityHome", previousTransactionStatisticsEntityHome);

			new Expectations() {
				{
					eodWrapper.getNextElement();
					returns(nextElemObj, null);

					{SubsidiaryAccountDAOFactory.getDAOInstance(anyString);	result = subsidiaryAccountEntityHome;};
					{subsidiaryAccountEntityHome.fetchMasterForLeanAct((SubsidiaryAccountEntityKey) any); result = subsidiaryAccountEntity;};
					{subsidiaryAccountEntity.getWrapper(); result = subsidiaryAccountWrapper;};
					{subsidiaryAccountWrapper.clone(); result = subsidiaryAccountWrapper;};
					
					{sysProperties.localLookup("eBBS/SubsidiaryAccountSession"); result = subsidiaryAccountSessionHome;};
					{subsidiaryAccountSessionHome.create(); result = subsidiaryAccountSession;};
					
					{subsidiaryAccountSession.updateMasterRelStatus(anyString, anyString, anyString, new Date(18012000), accountMasterWrapper);
					//result = new SCBApplicationException();
					};

					{productEntityHome.findByPrimaryKey((scb.ebbs.ecodes.ejb.ProductEntityKey) any); result = productEntity;}
					{productEntity.getWrapper(); result = productWrapper;};

					{accountMasterEntityHome.findByPrimaryKey((AccountMasterEntityKey) any); result = masterEntity;};
					{masterEntity.getWrapper();	result = accountMasterWrapper;};

					{PassbookDAOFactory.getDAOInstance(anyString); result = passbookEntityHome;};

					{
						Deencapsulation.invoke(businessProcessParamCache, "getInstance");
						result = businessProcessParamCache;
						businessProcessParamCache.getProcessParameters("RELSTATUSUPDATE_PARAM");
						result = abstractWrappers;
					};

					{querySessionHome.create();	result = querySession;};
					{querySession.getRelStatus(anyString); result = anyString;};

					{RelationshipDAOFactory.getDAOInstance(anyString); result = relationshipEntityHome;};

					{relationshipEntityHome.findByPrimaryKeyForUpdate((scb.ebbs.ecustomer.ejb.RelationshipEntityKey) any);
					result = relationshipEntity;};
					{relationshipEntity.getWrapper(); result = relationshipWrapper;};

					{businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.ACCOUNT_PARAM);
					result = abstractWrappers;};

					{scb.ebbs.util.StaticDataCache.getInstance(); result = staticDataCache;};
					{staticDataCache.getSystemWrapper(); result = systemWrapper;};

					{subsidiaryAccountSession.updateFeBeBalance(subsidiaryAccountWrapper, systemWrapper.systemDate,
								new Date(18012000));};

					{InterestAccrualDAOFactory.getDAOInstance(anyString); result = interestAccrualEntityHome;};
					{TPSDAOFactory.getDAOInstance(anyString); result = frontEndBalanceEntityHome;};
					{PostEngineDAOFactory.getDAOInstance(anyString); result = backendBalanceEntityHome;};

					{sysProperties.localLookup("eBBS/InterestSession"); result = interestSessionHome;};
					{interestSessionHome.create(); result = interestSession;};
					
					{interestSession.getInterestWrapper(anyString,anyString,(Date) any);
					result=interestWrapper;};
					
					{businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.GBA_ACCOUNT_PARAM);
					result = gbaAbstractWrapper;};
					
					{businessProcessParamCache.getProcessParameters(EBBSBusinessProcessConstants.MCA_ACCOUNT_PARAM);
					result = mcaBusinessParamWrapper;};
					
					{subsidiaryAccountSession.consolidatedStatementForIdaGbaAcc(subsidiaryAccountWrapper, productWrapper, gbaBppWarpper, 'N');};

					{EventProcessor.getInstance();  result = eventProcessor;};
					
					{subsidiaryAccountEntityHome.findByPrimaryKey((SubsidiaryAccountEntityKey)any); result = subsidiaryAccountEntity;};
					{subsidiaryAccountEntity.getWrapper(); result = subsidiaryAccountWrapper;};					
					{subsidiaryAccountSession.getEvents(subsidiaryAccountWrapper, subsidiaryAccountWrapper); result = argBusinessEvent;};
					
					{StatisticalFieldsDAOFactory.getDAOInstance("CurrentBalanceStatisticsEntity"); result = currentBalanceStatisticsEntityHome;};
					{currentBalanceStatisticsEntity.getWrapper(); result = balanceStatisticsWrapper;};					
					{StatisticalFieldsDAOFactory.getDAOInstance("CurrentInterestBearingBalanceStatisticsEntity"); result = currentInterestBearingBalanceStatisticsEntityHome;};
					{currentInterestBearingBalanceStatisticsEntity.getWrapper(); result = balanceStatisticsWrapper;};
					
				}
			};
				postenginesessionbean.processPostAccountCreationAction(eodWrapper);
			//Assert.assertTrue(true);
		} catch (Exception exObj) {
			//fail("Exception not Expected");
		}
	}
}

just analyse it and say niothing