Skip to content

Commit 747926a

Browse files
author
Piotr Kubicki
committed
fix: spotless apply
1 parent 1af9a60 commit 747926a

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

src/test/java/com/capgemini/training/appointmentbooking/dataaccess/repository/AppointmentRepositoryIT.java

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,17 @@ void shouldFindAppointmentsBySpecialistIdBeforeDate() {
162162
}
163163

164164
/**
165-
* Given a saved appointment from 11:45 to 12:00,
166-
* this test ensures that an earlier appointment does not trigger a conflict.
165+
* Given a saved appointment from 11:45 to 12:00, this test ensures that an
166+
* earlier appointment does not trigger a conflict.
167167
*/
168168
@Test
169169
void shouldNotFindConflictingAppointmentWhenNewAppointmentEndsBeforeExisting() {
170170
Long specialistId = -1L;
171171
Instant startDate = toInstant("2024-03-05 11:30:00");
172172
Instant endDate = toInstant("2024-03-05 11:45:00");
173173

174-
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId, startDate, endDate);
174+
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId,
175+
startDate, endDate);
175176

176177
assertThat(conflict).isFalse();
177178
}
@@ -185,49 +186,56 @@ void shouldNotFindConflictingAppointmentWhenNewAppointmentStartsAfterExisting()
185186
Instant startDate = toInstant("2024-03-05 12:00:00");
186187
Instant endDate = toInstant("2024-03-05 12:01:00");
187188

188-
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId, startDate, endDate);
189+
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId,
190+
startDate, endDate);
189191

190192
assertThat(conflict).isFalse();
191193
}
192194

193195
/**
194-
* Verifies that an appointment starting and ending at exactly the same time as an existing one is treated as a conflict.
196+
* Verifies that an appointment starting and ending at exactly the same time as
197+
* an existing one is treated as a conflict.
195198
*/
196199
@Test
197200
void shouldFindConflictingAppointmentWhenTimeMatchesExactly() {
198201
Long specialistId = -1L;
199202
Instant startDate = toInstant("2024-03-05 11:45:00");
200203
Instant endDate = toInstant("2024-03-05 12:00:00");
201204

202-
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId, startDate, endDate);
205+
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId,
206+
startDate, endDate);
203207

204208
assertThat(conflict).isTrue();
205209
}
206210

207211
/**
208-
* Ensures that an appointment which starts before and ends during the existing one is considered a conflict.
212+
* Ensures that an appointment which starts before and ends during the existing
213+
* one is considered a conflict.
209214
*/
210215
@Test
211216
void shouldFindConflictingAppointmentWhenEndingOverlapsWithExisting() {
212217
Long specialistId = -1L;
213218
Instant startDate = toInstant("2024-03-05 11:40:00");
214219
Instant endDate = toInstant("2024-03-05 11:45:01");
215220

216-
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId, startDate, endDate);
221+
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId,
222+
startDate, endDate);
217223

218224
assertThat(conflict).isTrue();
219225
}
220226

221227
/**
222-
* Checks that an appointment starting just before the end of an existing one is correctly flagged as a conflict.
228+
* Checks that an appointment starting just before the end of an existing one is
229+
* correctly flagged as a conflict.
223230
*/
224231
@Test
225232
void shouldFindConflictingAppointmentWhenStartingBeforeExistingEnds() {
226233
Long specialistId = -1L;
227234
Instant startDate = toInstant("2024-03-05 11:59:59");
228235
Instant endDate = toInstant("2024-03-05 12:05:00");
229236

230-
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId, startDate, endDate);
237+
boolean conflict = appointmentRepository.hasConflictingAppointmentBySpecialistIdAndDateTime(specialistId,
238+
startDate, endDate);
231239

232240
assertThat(conflict).isTrue();
233241
}

0 commit comments

Comments
 (0)