@Test(expected = VRaptorException.class) public void shouldNotSupportNonGenericLists() throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final SimpleNode node = mockery.ognlNode("nonGeneric"); mockery.checking( new Expectations() { { one(evaluation).getNode(); will(returnValue(node)); one(evaluation).getSource(); will(returnValue(client)); } }); handler.instantiate(container, client.nonGeneric, "2", evaluation); mockery.assertIsSatisfied(); }
@Test public void shouldInsertItemsUntilTheRequiredPosition() throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException { final SimpleNode node = mockery.ognlNode("names"); mockery.checking( new Expectations() { { one(evaluation).getNode(); will(returnValue(node)); one(evaluation).getSource(); will(returnValue(client)); one(removal).add(client.names); } }); handler.instantiate(container, client.names, 2, evaluation); assertThat(client.names.size(), is(equalTo(3))); assertThat(client.names.get(2), is(notNullValue())); mockery.assertIsSatisfied(); }