public void testFactoryMethodMustDeclareAllConstructorExceptions() { try { FactoryProvider.newFactory(DefectiveCarFactoryWithNoExceptions.class, DefectiveCar.class); fail(); } catch (ConfigurationException expected) { assertContains(expected.getMessage(), "no compatible exception is thrown"); } }
public void testFactoryMethodsMismatch() { try { FactoryProvider.newFactory(SummerCarFactory.class, Beetle.class); fail(); } catch (ConfigurationException e) { assertContains(e.getMessage(), "Constructor mismatch"); } }