Skip to content

Commit b4ab4f9

Browse files
committed
tweak
1 parent 7e4fcd3 commit b4ab4f9

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

generator/src/test/java/io/stubbs/truth/generator/internal/SourceClassSetsTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
public class SourceClassSetsTests {
1818

19-
// todo use bootstrapped ResultSubject
2019
@Test
2120
public void duplicatesClassInSpecifiedPackage() {
2221
TruthGenerator tg = TruthGeneratorAPI.createDefaultOptions(TEST_OUTPUT_DIRECTORY);

generator/src/test/java/io/stubbs/truth/generator/internal/TruthGeneratorTest.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.google.common.truth.Correspondence;
55
import com.google.common.truth.ObjectArraySubject;
66
import com.google.common.truth.Truth;
7+
import io.stubbs.truth.ManagedTruth;
78
import io.stubbs.truth.generator.SourceClassSets;
89
import io.stubbs.truth.generator.TestModelUtils;
910
import io.stubbs.truth.generator.TruthGeneratorAPI;
@@ -240,28 +241,28 @@ public void test_legacy_mode() {
240241
/**
241242
* Given a single class or classes, generate subjects for all references classes in any nested return values
242243
*/
243-
// todo use bootstrapped ResultSubject
244244
@Test
245245
public void recursive_generation() {
246246
TruthGenerator tg = TruthGeneratorAPI.createDefaultOptions(TEST_OUTPUT_DIRECTORY);
247-
var allGeneratedSystems = tg.generate(MyEmployee.class).getAll();
247+
var allGeneratedSystems = tg.generate(MyEmployee.class);
248248

249249
//
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);
253254

254255
// lost in the generics
255-
assertThat(allGeneratedSystems).doesNotContainKey(Project.class);
256+
assertGeneratedSet.doesNotContainKey(Project.class);
256257

257258
//
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);
261262

262263
// 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);
265266
}
266267

267268
/**

0 commit comments

Comments
 (0)