Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

offer converters for comparisson #2

Open
vincemann opened this issue Jan 26, 2022 · 1 comment
Open

offer converters for comparisson #2

vincemann opened this issue Jan 26, 2022 · 1 comment

Comments

@vincemann
Copy link
Owner

i.E.:
compare(readModuleDto).with(savedModule)
.properties()
.all()
useConverter<Long,IdentifiableEntity>((a,b) -> {
if(b.contains("id")){
return a.equals(b.getId().toString())
})
.assertEqual();

will compare longs with propertynames containing "id" to respective entity.getId()

@vincemann
Copy link
Owner Author

otherwise looks more like this:
compare(readModuleDto).with(savedModule)
.properties()
.all()
.ignore(readModuleDto::getExerciseGroupIds)
.ignore(readModuleDto::getSchoolId)
.assertEqual();

    Assertions.assertEquals(objectGraphFactory.getSchool().getId(),readModuleDto.getSchoolId());
    Assertions.assertEquals(objectGraphFactory.getSchool(),savedModule.getSchool());

vincemann added a commit that referenced this issue Jan 26, 2022
vincemann added a commit that referenced this issue Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant