diff --git a/src/main/asciidoc/reference/cassandra-repositories.adoc b/src/main/asciidoc/reference/cassandra-repositories.adoc index 0387b6c0a..ce3e2ea80 100644 --- a/src/main/asciidoc/reference/cassandra-repositories.adoc +++ b/src/main/asciidoc/reference/cassandra-repositories.adoc @@ -113,14 +113,13 @@ Working with the repository instance is a matter of injecting the repository as ==== [source,java] ---- -@RunWith(SpringRunner.class) -@ContextConfiguration -public class PersonRepositoryTests { +@ExtendWith(SpringExtension.class) +class PersonRepositoryTests { @Autowired PersonRepository repository; @Test - public void readsPersonTableCorrectly() { + void readsPersonTableCorrectly() { List persons = repository.findAll(); assertThat(persons.isEmpty()).isFalse(); @@ -138,14 +137,13 @@ The following example shows how to set up paging access to `Person` entities: ==== [source,java] ---- -@RunWith(SpringRunner.class) -@ContextConfiguration -public class PersonRepositoryTests { +@ExtendWith(SpringExtension.class) +class PersonRepositoryTests { @Autowired PersonRepository repository; @Test - public void readsPagesCorrectly() { + void readsPagesCorrectly() { Slice firstBatch = repository.findAll(CassandraPageRequest.first(10)); @@ -176,7 +174,7 @@ The following example shows a number of such method declarations: ==== [source,java] ---- -public interface PersonRepository extends CrudRepository { +interface PersonRepository extends CrudRepository { List findByLastname(String lastname); <1> @@ -328,7 +326,7 @@ The following example sets the consistency level to `ConsistencyLevel.LOCAL_ONE` ==== [source,java] ---- -public interface PersonRepository extends CrudRepository { +interface PersonRepository extends CrudRepository { @Consistency(ConsistencyLevel.LOCAL_ONE) List findByLastname(String lastname); diff --git a/src/main/asciidoc/reference/reactive-cassandra-repositories.adoc b/src/main/asciidoc/reference/reactive-cassandra-repositories.adoc index fef5a0175..05b227315 100644 --- a/src/main/asciidoc/reference/reactive-cassandra-repositories.adoc +++ b/src/main/asciidoc/reference/reactive-cassandra-repositories.adoc @@ -145,14 +145,13 @@ The following example shows how to set up paging access to `Person` entities: ==== [source,java] ---- -@RunWith(SpringRunner.class) -@ContextConfiguration -public class PersonRepositoryTests { +@ExtendWith(SpringExtension.class) +class PersonRepositoryTests { @Autowired PersonRepository repository; @Test - public void readsPagesCorrectly() { + void readsPagesCorrectly() { Mono> firstBatch = repository.findAll(CassandraPageRequest.first(10));