Skip to content

Commit 0131eeb

Browse files
committed
Polishing.
Switch documentation samples to JUnit 5.
1 parent befa0ff commit 0131eeb

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

src/main/asciidoc/reference/cassandra-repositories.adoc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,13 @@ Working with the repository instance is a matter of injecting the repository as
113113
====
114114
[source,java]
115115
----
116-
@RunWith(SpringRunner.class)
117-
@ContextConfiguration
118-
public class PersonRepositoryTests {
116+
@ExtendWith(SpringExtension.class)
117+
class PersonRepositoryTests {
119118
120119
@Autowired PersonRepository repository;
121120
122121
@Test
123-
public void readsPersonTableCorrectly() {
122+
void readsPersonTableCorrectly() {
124123
125124
List<Person> persons = repository.findAll();
126125
assertThat(persons.isEmpty()).isFalse();
@@ -138,14 +137,13 @@ The following example shows how to set up paging access to `Person` entities:
138137
====
139138
[source,java]
140139
----
141-
@RunWith(SpringRunner.class)
142-
@ContextConfiguration
143-
public class PersonRepositoryTests {
140+
@ExtendWith(SpringExtension.class)
141+
class PersonRepositoryTests {
144142
145143
@Autowired PersonRepository repository;
146144
147145
@Test
148-
public void readsPagesCorrectly() {
146+
void readsPagesCorrectly() {
149147
150148
Slice<Person> firstBatch = repository.findAll(CassandraPageRequest.first(10));
151149
@@ -176,7 +174,7 @@ The following example shows a number of such method declarations:
176174
====
177175
[source,java]
178176
----
179-
public interface PersonRepository extends CrudRepository<Person, String> {
177+
interface PersonRepository extends CrudRepository<Person, String> {
180178
181179
List<Person> findByLastname(String lastname); <1>
182180
@@ -328,7 +326,7 @@ The following example sets the consistency level to `ConsistencyLevel.LOCAL_ONE`
328326
====
329327
[source,java]
330328
----
331-
public interface PersonRepository extends CrudRepository<Person, String> {
329+
interface PersonRepository extends CrudRepository<Person, String> {
332330
333331
@Consistency(ConsistencyLevel.LOCAL_ONE)
334332
List<Person> findByLastname(String lastname);

src/main/asciidoc/reference/reactive-cassandra-repositories.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,13 @@ The following example shows how to set up paging access to `Person` entities:
145145
====
146146
[source,java]
147147
----
148-
@RunWith(SpringRunner.class)
149-
@ContextConfiguration
150-
public class PersonRepositoryTests {
148+
@ExtendWith(SpringExtension.class)
149+
class PersonRepositoryTests {
151150
152151
@Autowired PersonRepository repository;
153152
154153
@Test
155-
public void readsPagesCorrectly() {
154+
void readsPagesCorrectly() {
156155
157156
Mono<Slice<Person>> firstBatch = repository.findAll(CassandraPageRequest.first(10));
158157

0 commit comments

Comments
 (0)