|
4 | 4 | import com.google.common.truth.Correspondence; |
5 | 5 | import com.google.common.truth.ObjectArraySubject; |
6 | 6 | import com.google.common.truth.Truth; |
| 7 | +import io.stubbs.truth.ManagedTruth; |
7 | 8 | import io.stubbs.truth.generator.SourceClassSets; |
8 | 9 | import io.stubbs.truth.generator.TestModelUtils; |
9 | 10 | import io.stubbs.truth.generator.TruthGeneratorAPI; |
@@ -240,28 +241,28 @@ public void test_legacy_mode() { |
240 | 241 | /** |
241 | 242 | * Given a single class or classes, generate subjects for all references classes in any nested return values |
242 | 243 | */ |
243 | | - // todo use bootstrapped ResultSubject |
244 | 244 | @Test |
245 | 245 | public void recursive_generation() { |
246 | 246 | TruthGenerator tg = TruthGeneratorAPI.createDefaultOptions(TEST_OUTPUT_DIRECTORY); |
247 | | - var allGeneratedSystems = tg.generate(MyEmployee.class).getAll(); |
| 247 | + var allGeneratedSystems = tg.generate(MyEmployee.class); |
248 | 248 |
|
249 | 249 | // |
250 | | - assertThat(allGeneratedSystems).containsKey(MyEmployee.class); |
251 | | - assertThat(allGeneratedSystems).containsKey(IdCard.class); |
252 | | - assertThat(allGeneratedSystems).containsKey(MyEmployee.State.class); |
| 250 | + var assertGeneratedSet = ManagedTruth.assertThat(allGeneratedSystems).getAll(); |
| 251 | + assertGeneratedSet.containsKey(MyEmployee.class); |
| 252 | + assertGeneratedSet.containsKey(IdCard.class); |
| 253 | + assertGeneratedSet.containsKey(MyEmployee.State.class); |
253 | 254 |
|
254 | 255 | // lost in the generics |
255 | | - assertThat(allGeneratedSystems).doesNotContainKey(Project.class); |
| 256 | + assertGeneratedSet.doesNotContainKey(Project.class); |
256 | 257 |
|
257 | 258 | // |
258 | | - assertThat(allGeneratedSystems).containsKey(UUID.class); |
259 | | - assertThat(allGeneratedSystems).containsKey(ZonedDateTime.class); |
260 | | - assertThat(allGeneratedSystems).containsKey(DayOfWeek.class); |
| 259 | + assertGeneratedSet.containsKey(UUID.class); |
| 260 | + assertGeneratedSet.containsKey(ZonedDateTime.class); |
| 261 | + assertGeneratedSet.containsKey(DayOfWeek.class); |
261 | 262 |
|
262 | 263 | // recursive subjects that shouldn't be included |
263 | | - assertThat(allGeneratedSystems).doesNotContainKey(Spliterator.class); |
264 | | - assertThat(allGeneratedSystems).doesNotContainKey(Stream.class); |
| 264 | + assertGeneratedSet.doesNotContainKey(Spliterator.class); |
| 265 | + assertGeneratedSet.doesNotContainKey(Stream.class); |
265 | 266 | } |
266 | 267 |
|
267 | 268 | /** |
|
0 commit comments