BAEL-6110: Fix Spring Data JPA Exception: No Property Found for Type (#13753)
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
package com.baeldung.nopropertyfound;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||
|
||||
import com.baeldung.nopropertyfound.model.Person;
|
||||
import com.baeldung.nopropertyfound.repository.PersonRepository;
|
||||
|
||||
@DataJpaTest
|
||||
class PersonRepositoryIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private PersonRepository personRepository;
|
||||
|
||||
@Test
|
||||
void givenQueryMethod_whenUsingValidProperty_thenCorrect() {
|
||||
|
||||
Person person = personRepository.findByFirstName("Azhrioun");
|
||||
|
||||
assertNotNull(person);
|
||||
assertEquals("Abderrahim", person.getLastName());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user