Package org.springframework.data.mapping

Examples of org.springframework.data.mapping.PreferredConstructor$Parameter


   */
  @Test
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void instantiateObjectCtor1ParamInt() {

    PreferredConstructor constructor = new PreferredConstructorDiscoverer<ObjectCtor1ParamInt, P>(
        ObjectCtor1ParamInt.class).getConstructor();

    when(entity.getType()).thenReturn((Class) ObjectCtor1ParamInt.class);
    when(entity.getPersistenceConstructor()).thenReturn(constructor);

View Full Code Here


   */
  @Test
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void instantiateObjectCtor7ParamsString5IntsString() {

    PreferredConstructor constructor = new PreferredConstructorDiscoverer<ObjectCtor7ParamsString5IntsString, P>(
        ObjectCtor7ParamsString5IntsString.class).getConstructor();

    when(entity.getType()).thenReturn((Class) ObjectCtor7ParamsString5IntsString.class);
    when(entity.getPersistenceConstructor()).thenReturn(constructor);

View Full Code Here

  @Test
  @SuppressWarnings({ "unchecked", "rawtypes" })
  public void instantiatesTypeWithPreferredConstructorUsingParameterValueProvider() {

    PreferredConstructor constructor = new PreferredConstructorDiscoverer<Foo, P>(Foo.class).getConstructor();

    when(entity.getType()).thenReturn((Class) Foo.class);
    when(entity.getPersistenceConstructor()).thenReturn(constructor);

    Object instance = INSTANCE.createInstance(entity, provider);

    assertTrue(instance instanceof Foo);
    verify(provider, times(1)).getParameterValue((Parameter) constructor.getParameters().iterator().next());
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.mapping.PreferredConstructor$Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.