@Test void testCreateInstance() throws Exception { Method someMethod = getClass().getMethod("someMethod", UnitOfWork.class); assertNull(testSubject.createInstance(method, method.getParameters(), 0)); assertSame(testSubject, testSubject.createInstance(someMethod, someMethod.getParameters(), 0)); }
@Override public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (UnitOfWork.class.equals(parameters[parameterIndex].getType())) { return this; } return null; }
CurrentUnitOfWorkParameterResolverFactory implements ParameterResolverFactory, ParameterResolver { @Override public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (UnitOfWork.class.equals(parameters[parameterIndex].getType())) { return this; } return null; } }
CurrentUnitOfWorkParameterResolverFactory implements ParameterResolverFactory, ParameterResolver { @Override public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (UnitOfWork.class.equals(parameters[parameterIndex].getType())) { return this; } return null; }  }
CurrentUnitOfWorkParameterResolverFactory implements ParameterResolverFactory, ParameterResolver { @Override public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (UnitOfWork.class.equals(parameters[parameterIndex].getType())) { return this; } return null; }  @Override ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex); @Override Object resolveParameterValue(Message message); @Override boolean matches(Message message); }
CurrentUnitOfWorkParameterResolverFactory implements ParameterResolverFactory, ParameterResolver { @Override public ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex) { if (UnitOfWork.class.equals(parameters[parameterIndex].getType())) { return this; } return null; }  @Override ParameterResolver createInstance(Executable executable, Parameter[] parameters, int parameterIndex); @Override Object resolveParameterValue(Message message); @Override boolean matches(Message message);  }