@Test public void getBusinessLogicOk() { new Expectations() { { type.getClassname(); returns(HierarchyFixCommission.class.getName()); } }; final ICommissionType result = type.getBusinessLogic(null); assertTrue(result instanceof HierarchyFixCommission); }
@Test public void getBusinessLogicClassNotFound() { new Expectations() { { type.getClassname(); returns("no.such.class"); } }; try { type.getBusinessLogic(null); fail("expected AdempiereException because class doesn't exist"); } catch (AdempiereException e) { } }
@Test public void getBusinessLogicClassNoCommissionTerm() { new Expectations() { { type.getClassname(); returns(String.class.getName()); } }; try { type.getBusinessLogic(null); fail("expected AdempiereException because class is no ICommissionTerm"); } catch (AdempiereException e) { } }