Skip to content

wyattjsmith1/data-rest-version-createdby-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

data-rest-version-createdby-bug

This exposes a bug when a Spring Data Rest model has both an @Version and a @CreatedDate. When saved to a repository, the @CreatedDate will not be set.

This repo has two models and repos: ModelWithVersion and ModelWithoutVersion (and their respective repositories).

The repos each have tests where a model is saved, and there are checks that @CreatedDate and @Version are set. This will fail on the ModelWithVersionRepository

@Test
public void test_save_setsDateCreatedAndVersion() {
    repository.save(modelWithVersion);

    assertNotNull(modelWithVersion.getLastModified());
    assertNotNull(modelWithVersion.getCreated());
    assertNotNull(modelWithVersion.getVersion());
}

To run all tests:

./gradlew test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages