Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
astubbs committed Apr 21, 2022
1 parent 7e4fcd3 commit b4ab4f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
public class SourceClassSetsTests {

// todo use bootstrapped ResultSubject
@Test
public void duplicatesClassInSpecifiedPackage() {
TruthGenerator tg = TruthGeneratorAPI.createDefaultOptions(TEST_OUTPUT_DIRECTORY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.common.truth.Correspondence;
import com.google.common.truth.ObjectArraySubject;
import com.google.common.truth.Truth;
import io.stubbs.truth.ManagedTruth;
import io.stubbs.truth.generator.SourceClassSets;
import io.stubbs.truth.generator.TestModelUtils;
import io.stubbs.truth.generator.TruthGeneratorAPI;
Expand Down Expand Up @@ -240,28 +241,28 @@ public void test_legacy_mode() {
/**
* Given a single class or classes, generate subjects for all references classes in any nested return values
*/
// todo use bootstrapped ResultSubject
@Test
public void recursive_generation() {
TruthGenerator tg = TruthGeneratorAPI.createDefaultOptions(TEST_OUTPUT_DIRECTORY);
var allGeneratedSystems = tg.generate(MyEmployee.class).getAll();
var allGeneratedSystems = tg.generate(MyEmployee.class);

//
assertThat(allGeneratedSystems).containsKey(MyEmployee.class);
assertThat(allGeneratedSystems).containsKey(IdCard.class);
assertThat(allGeneratedSystems).containsKey(MyEmployee.State.class);
var assertGeneratedSet = ManagedTruth.assertThat(allGeneratedSystems).getAll();
assertGeneratedSet.containsKey(MyEmployee.class);
assertGeneratedSet.containsKey(IdCard.class);
assertGeneratedSet.containsKey(MyEmployee.State.class);

// lost in the generics
assertThat(allGeneratedSystems).doesNotContainKey(Project.class);
assertGeneratedSet.doesNotContainKey(Project.class);

//
assertThat(allGeneratedSystems).containsKey(UUID.class);
assertThat(allGeneratedSystems).containsKey(ZonedDateTime.class);
assertThat(allGeneratedSystems).containsKey(DayOfWeek.class);
assertGeneratedSet.containsKey(UUID.class);
assertGeneratedSet.containsKey(ZonedDateTime.class);
assertGeneratedSet.containsKey(DayOfWeek.class);

// recursive subjects that shouldn't be included
assertThat(allGeneratedSystems).doesNotContainKey(Spliterator.class);
assertThat(allGeneratedSystems).doesNotContainKey(Stream.class);
assertGeneratedSet.doesNotContainKey(Spliterator.class);
assertGeneratedSet.doesNotContainKey(Stream.class);
}

/**
Expand Down

0 comments on commit b4ab4f9

Please sign in to comment.