Created
June 14, 2017 11:39
-
-
Save dotkebi/f7e14599640736c0d83b29b6ac299aa1 to your computer and use it in GitHub Desktop.
ExampleMatacherTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(SpringRunner.class) | |
@SpringBootTest | |
public class ExampleMatcherTest { | |
@Autowired | |
private ExampleRepository repository; | |
@Test | |
public void exampleTest() { | |
Child child = new Child(); | |
child.setName("C"); | |
Parent parent = new Parent(); | |
parent.setChild(child); | |
ExampleMatcher matcher = ExampleMatcher.matching() | |
.withIgnoreNullValues() | |
.withStringMatcher(ExampleMatcher.StringMatcher.CONTAINING); | |
Example<Parent> example = Example.of(parent, matcher); | |
assertTrue(repository.findAll(example).size > 0); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ExampleRepository extends JpaRepository<Parent, Long> { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment