Skip to content

Commit eb1a1ab

Browse files
author
eugenp
committed
search work
1 parent 9f2ac2b commit eb1a1ab

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎src/test/java/org/rest/sec/persistence/service/RoleServiceSearchPersistenceIntegrationTest.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ public final void givenEntityExists_whenSearchIsPerformedByIncorrectIdAndCorrect
147147
// Then
148148
assertThat( searchResults, not( hasItem( existingEntity ) ) );
149149
}
150+
@Test
151+
public final void givenEntityExists_whenSearchIsPerformedByCorrectIdAndIncorrectName_thenResultIsNotFound(){
152+
final Role existingEntity = getService().create( createNewEntity() );
153+
154+
// When
155+
final ImmutablePair< String, String > nameConstraint = new ImmutablePair< String, String >( NAME, randomAlphabetic( 8 ) );
156+
final ImmutablePair< String, Long > idConstraint = new ImmutablePair< String, Long >( ID, existingEntity.getId() );
157+
final List< Role > searchResults = getService().search( nameConstraint, idConstraint );
158+
159+
// Then
160+
assertThat( searchResults, not( hasItem( existingEntity ) ) );
161+
}
150162

151163
// template method
152164

0 commit comments

Comments
 (0)