I read the @Tested Javadoc little bit more carefully. There it states, that you could use test method parameters to setup the @Tested/class under test. Just declare a @Incectable parameter of the type you need. Read the @Tested javadoc to find out how the params are matched to the uninitialized fields.
so, my test works with this:
@Test
public void should_store_new_verfahren_to_persistence_layer(@Injectable final EntityManager em){
List<Verfahren> listeMitEinemNeuenVerfahren = new ArrayList<Verfahren>();
Verfahren v = new Verfahren();
v.setId(0);
v.setExterneId("Neu");
v.setFremdsystem(Verfahren.FREMDSYSTEM_P);
listeMitEinemNeuenVerfahren.add(v);
new NonStrictExpectations(archiveService) {
{
archiveService.getVerfahrenByExterneID(anyString, anyString);result = null;
}
};
new Expectations() {
{
em.persist(any);
}
};
archiveService.storeAndUpdateVerfahren(listeMitEinemNeuenVerfahren);
}