@Test public void addSubjectResourceTypeWithoutTrackedEntityType() { final WritableProgram program = new WritableProgram(); program.setName( "Test Program" ); program.setDescription( "Test Description" ); program.setWithoutRegistration( false ); program.setStages( new ArrayList<>() ); Assert.assertNull( ProgramTrackedEntityTypeUtils.getTrackedEntityFhirResourceType( trackedEntityMetadataService, trackedEntityRuleRepository, program ) ); }
@Nullable public static FhirResourceType getTrackedEntityFhirResourceType( @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull Program program ) { return getTrackedEntityRule( trackedEntityMetadataService, trackedEntityRuleRepository, program ).map( AbstractRule::getFhirResourceType ).orElse( null ); }
ProgramTrackedEntityTypeUtils { @Nullable public static FhirResourceType getTrackedEntityFhirResourceType( @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull Program program ) { return getTrackedEntityRule( trackedEntityMetadataService, trackedEntityRuleRepository, program ).map( AbstractRule::getFhirResourceType ).orElse( null ); } }
ProgramTrackedEntityTypeUtils { @Nullable public static FhirResourceType getTrackedEntityFhirResourceType( @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull Program program ) { return getTrackedEntityRule( trackedEntityMetadataService, trackedEntityRuleRepository, program ).map( AbstractRule::getFhirResourceType ).orElse( null ); } private  ProgramTrackedEntityTypeUtils(); }
ProgramTrackedEntityTypeUtils { @Nullable public static FhirResourceType getTrackedEntityFhirResourceType( @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull Program program ) { return getTrackedEntityRule( trackedEntityMetadataService, trackedEntityRuleRepository, program ).map( AbstractRule::getFhirResourceType ).orElse( null ); } private  ProgramTrackedEntityTypeUtils(); @Nonnull static Optional<TrackedEntityRule> getTrackedEntityRule(
        @Nonnull TrackedEntityMetadataService trackedEntityMetadataService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository,
        @Nonnull Program program ); @Nullable static FhirResourceType getTrackedEntityFhirResourceType(
        @Nonnull TrackedEntityMetadataService trackedEntityMetadataService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository,
        @Nonnull Program program ); }
ProgramTrackedEntityTypeUtils { @Nullable public static FhirResourceType getTrackedEntityFhirResourceType( @Nonnull TrackedEntityMetadataService trackedEntityMetadataService, @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository, @Nonnull Program program ) { return getTrackedEntityRule( trackedEntityMetadataService, trackedEntityRuleRepository, program ).map( AbstractRule::getFhirResourceType ).orElse( null ); } private  ProgramTrackedEntityTypeUtils(); @Nonnull static Optional<TrackedEntityRule> getTrackedEntityRule(
        @Nonnull TrackedEntityMetadataService trackedEntityMetadataService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository,
        @Nonnull Program program ); @Nullable static FhirResourceType getTrackedEntityFhirResourceType(
        @Nonnull TrackedEntityMetadataService trackedEntityMetadataService,
        @Nonnull TrackedEntityRuleRepository trackedEntityRuleRepository,
        @Nonnull Program program );  }