@Test(expected = PostProcessingException.class) public void throwsWhenNotExistingProperty() { ExpressionPostProcessor expressionPostProcessor = new ExpressionPostProcessor("notExistingProperty", this); Person person = ObjectG.unique(Person.class); expressionPostProcessor.process(new GenerationConfiguration(), person); }
@Test public void handlerIsCalled() { ExpressionPostProcessor expressionPostProcessor = new ExpressionPostProcessor("employee2Addresses[0].id", this); Person person = ObjectG.unique(Person.class); expressionPostProcessor.process(new GenerationConfiguration(), person); assertEquals("handleGeneratedObject", person, handleGeneratedObject); assertNotNull("expressionGenerationContext", handleContextForExpression); }