@Test
public void priceInSafeZoneTest() {

	MovingAverageCalculationService<N> movingAvgCalcService = mock(MovingAverageCalculationService.class);
	BaseTradingConfig baseTradingCfg = mock(BaseTradingConfig.class);
	PreOrderValidationService<M, N, K> service = new PreOrderValidationService<M, N, K>(null, movingAvgCalcService,
			baseTradingCfg, null);
	when(baseTradingCfg.getMax10yrWmaOffset()).thenReturn(0.1);
	TradeableInstrument<N> eurusd = new TradeableInstrument<N>("EUR_USD");
	when(
			movingAvgCalcService.calculateWMA(eq(eurusd), eq(PreOrderValidationService.FIVE_YRS_IN_MTHS),
					eq(CandleStickGranularity.M))).thenReturn(1.22);
	assertTrue(service.isInSafeZone(TradingSignal.LONG, 1.3, eurusd));
	assertTrue(service.isInSafeZone(TradingSignal.SHORT, 1.11, eurusd));
	assertFalse(service.isInSafeZone(TradingSignal.LONG, 1.36, eurusd));
	assertFalse(service.isInSafeZone(TradingSignal.SHORT, 1.05, eurusd));
}