Package org.springframework.data.mapping.context

Examples of org.springframework.data.mapping.context.SampleMappingContext


    private final RepositoryMetadata repositoryMetadata;
    private final SampleMappingContext mappingContext;

    public SampleRepoFactoryInformation(Class<?> repositoryInterface) {
      this.repositoryMetadata = new DefaultRepositoryMetadata(repositoryInterface);
      this.mappingContext = new SampleMappingContext();
    }
View Full Code Here


   * @see DATACMNS-365
   */
  @Test
  public void detectsPropertyWithAnnotation() {

    SampleMappingContext context = new SampleMappingContext();
    PersistentEntity<Object, SamplePersistentProperty> entity = context.getPersistentEntity(Entity.class);

    PersistentProperty<?> property = entity.getPersistentProperty(LastModifiedBy.class);
    assertThat(property, is(notNullValue()));
    assertThat(property.getName(), is("field"));

View Full Code Here

  AuditableBeanWrapperFactory factory;

  @Before
  public void setUp() {
    factory = new MappingAuditableBeanWrapperFactory(new SampleMappingContext());
  }
View Full Code Here

    auditorAware = mock(AuditorAware.class);
    when(auditorAware.getCurrentAuditor()).thenReturn(user);
  }

  protected AuditingHandler getHandler() {
    return new AuditingHandler(new SampleMappingContext());
  }
View Full Code Here

  SampleMappingContext mappingContext;

  @Before
  public void init() {
    this.mappingContext = new SampleMappingContext();
  }
View Full Code Here

  /**
   * @see DATACMNS-365
   */
  @Test
  public void setsUpHandlerWithMappingContext() {
    new IsNewAwareAuditingHandler(new SampleMappingContext());
  }
View Full Code Here

  SampleMappingContext ctx;

  @Before
  public void setup() {
    ctx = new SampleMappingContext();
  }
View Full Code Here

  SampleMappingContext mappingContext;
  TypeInformationMapper mapper;

  @Before
  public void setUp() {
    mappingContext = new SampleMappingContext();
  }
View Full Code Here

  }

  @Test
  public void extractsAliasForUnknownType() {

    SampleMappingContext mappingContext = new SampleMappingContext();
    mappingContext.initialize();

    mapper = new MappingContextTypeInformationMapper(mappingContext);

    assertThat(mapper.createAliasFor(from(Entity.class)), is((Object) "foo"));
  }
View Full Code Here

  }

  @Test
  public void doesNotReturnTypeAliasForSimpleType() {

    SampleMappingContext mappingContext = new SampleMappingContext();
    mappingContext.initialize();

    mapper = new MappingContextTypeInformationMapper(mappingContext);
    assertThat(mapper.createAliasFor(from(String.class)), is(nullValue()));
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.mapping.context.SampleMappingContext

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.