Skip to content

Commit 961b162

Browse files
committed
disable_projection_checking testcase
1 parent cce0e58 commit 961b162

8 files changed

Lines changed: 14 additions & 164 deletions

File tree

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/build.gradle.kts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ kobby {
3030
)
3131

3232
impl {
33-
projectionCheckingEnabled = true
33+
projectionCheckingEnabled = false
3434
}
3535
}
3636
}

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/ActorImpl.kt.txt

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import kotlin.collections.Set
4545
import kotlin.collections.listOf
4646
import kotlin.collections.map
4747
import kotlin.collections.setOf
48-
import kotlin.error
4948
import kotlin.text.StringBuilder
5049
import kotlin.text.buildString
5150
import kotlin.text.isNotEmpty
@@ -62,61 +61,32 @@ internal class ActorImpl(
6261
get() = __innerDto.id!!
6362

6463
override val fields: JsonObject
65-
get() {
66-
if (__innerProjection.__innerFields1 == null) {
67-
error("Property [fields] is not available - add [fields] projection to switch on it")
68-
}
69-
return __innerDto.fields!!
70-
}
64+
get() = __innerDto.fields!!
7165

7266
override val tags: List<Tag> by lazy {
73-
if (__innerProjection.__innerTags2 == null) {
74-
error("Property [tags] is not available - add [tags] projection to switch on it")
75-
}
7667
__innerDto.resolveTags(__innerContext, __innerProjection.__innerTags2!!)
7768
}
7869

7970
override val firstName: String
80-
get() {
81-
if (!__innerProjection.__innerFirstName3) {
82-
error("Property [firstName] is not available - remove [__withoutFirstName] projection to switch on it")
83-
}
84-
return __innerDto.firstName!!
85-
}
71+
get() = __innerDto.firstName!!
8672

8773
override val lastName: String?
88-
get() {
89-
if (!__innerProjection.__innerLastName4) {
90-
error("Property [lastName] is not available - remove [__withoutLastName] projection to switch on it")
91-
}
92-
return __innerDto.lastName
93-
}
74+
get() = __innerDto.lastName
9475

9576
override val birthday: LocalDate
9677
get() = __innerDto.birthday!!
9778

9879
override val gender: Gender
99-
get() {
100-
if (!__innerProjection.__innerGender6) {
101-
error("Property [gender] is not available - add [gender] projection to switch on it")
102-
}
103-
return __innerDto.gender!!
104-
}
80+
get() = __innerDto.gender!!
10581

10682
override val countryId: Long
10783
get() = __innerDto.countryId!!
10884

10985
override val country: Country by lazy {
110-
if (__innerProjection.__innerCountry8 == null) {
111-
error("Property [country] is not available - add [country] projection to switch on it")
112-
}
11386
__innerDto.resolveCountry(__innerContext, __innerProjection.__innerCountry8!!)
11487
}
11588

11689
override val films: List<Film> by lazy {
117-
if (__innerProjection.__innerFilms9 == null) {
118-
error("Property [films] is not available - add [films] projection to switch on it")
119-
}
12090
__innerDto.resolveFilms(__innerContext, __innerProjection.__innerFilms9!!)
12191
}
12292

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/CountryImpl.kt.txt

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import kotlin.collections.Set
5151
import kotlin.collections.listOf
5252
import kotlin.collections.map
5353
import kotlin.collections.setOf
54-
import kotlin.error
5554
import kotlin.text.StringBuilder
5655
import kotlin.text.buildString
5756
import kotlin.text.isNotEmpty
@@ -69,60 +68,32 @@ internal class CountryImpl(
6968
get() = __innerDto.id!!
7069

7170
override val fields: JsonObject
72-
get() {
73-
if (__innerProjection.__innerFields1 == null) {
74-
error("Property [fields] is not available - add [fields] projection to switch on it")
75-
}
76-
return __innerDto.fields!!
77-
}
71+
get() = __innerDto.fields!!
7872

7973
override val name: String
80-
get() {
81-
if (!__innerProjection.__innerName2) {
82-
error("Property [name] is not available - remove [__withoutName] projection to switch on it")
83-
}
84-
return __innerDto.name!!
85-
}
74+
get() = __innerDto.name!!
8675

8776
override val film: Film? by lazy {
88-
if (__innerProjection.__innerFilm3 == null) {
89-
error("Property [film] is not available - add [film] projection to switch on it")
90-
}
9177
__innerDto.resolveFilm(__innerContext, __innerProjection.__innerFilm3!!)
9278
}
9379

9480
override val films: List<Film> by lazy {
95-
if (__innerProjection.__innerFilms4 == null) {
96-
error("Property [films] is not available - add [films] projection to switch on it")
97-
}
9881
__innerDto.resolveFilms(__innerContext, __innerProjection.__innerFilms4!!)
9982
}
10083

10184
override val actor: Actor? by lazy {
102-
if (__innerProjection.__innerActor5 == null) {
103-
error("Property [actor] is not available - add [actor] projection to switch on it")
104-
}
10585
__innerDto.resolveActor(__innerContext, __innerProjection.__innerActor5!!)
10686
}
10787

10888
override val actors: List<Actor> by lazy {
109-
if (__innerProjection.__innerActors6 == null) {
110-
error("Property [actors] is not available - add [actors] projection to switch on it")
111-
}
11289
__innerDto.resolveActors(__innerContext, __innerProjection.__innerActors6!!)
11390
}
11491

11592
override val taggable: List<Taggable> by lazy {
116-
if (__innerProjection.__innerTaggable7 == null) {
117-
error("Property [taggable] is not available - add [taggable] projection to switch on it")
118-
}
11993
__innerDto.resolveTaggable(__innerContext, __innerProjection.__innerTaggable7!!)
12094
}
12195

12296
override val native: List<Native> by lazy {
123-
if (__innerProjection.__innerNative8 == null) {
124-
error("Property [native] is not available - add [native] projection to switch on it")
125-
}
12697
__innerDto.resolveNative(__innerContext, __innerProjection.__innerNative8!!)
12798
}
12899

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/FilmImpl.kt.txt

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ import kotlin.collections.Set
4646
import kotlin.collections.listOf
4747
import kotlin.collections.map
4848
import kotlin.collections.setOf
49-
import kotlin.error
5049
import kotlin.text.StringBuilder
5150
import kotlin.text.buildString
5251
import kotlin.text.isNotEmpty
@@ -64,50 +63,26 @@ internal class FilmImpl(
6463
get() = __innerDto.id!!
6564

6665
override val fields: JsonObject
67-
get() {
68-
if (__innerProjection.__innerFields1 == null) {
69-
error("Property [fields] is not available - add [fields] projection to switch on it")
70-
}
71-
return __innerDto.fields!!
72-
}
66+
get() = __innerDto.fields!!
7367

7468
override val tags: List<Tag> by lazy {
75-
if (__innerProjection.__innerTags2 == null) {
76-
error("Property [tags] is not available - add [tags] projection to switch on it")
77-
}
7869
__innerDto.resolveTags(__innerContext, __innerProjection.__innerTags2!!)
7970
}
8071

8172
override val title: String
82-
get() {
83-
if (!__innerProjection.__innerTitle3) {
84-
error("Property [title] is not available - remove [__withoutTitle] projection to switch on it")
85-
}
86-
return __innerDto.title!!
87-
}
73+
get() = __innerDto.title!!
8874

8975
override val genre: Genre
90-
get() {
91-
if (!__innerProjection.__innerGenre4) {
92-
error("Property [genre] is not available - add [genre] projection to switch on it")
93-
}
94-
return __innerDto.genre!!
95-
}
76+
get() = __innerDto.genre!!
9677

9778
override val countryId: Long
9879
get() = __innerDto.countryId!!
9980

10081
override val country: Country by lazy {
101-
if (__innerProjection.__innerCountry6 == null) {
102-
error("Property [country] is not available - add [country] projection to switch on it")
103-
}
10482
__innerDto.resolveCountry(__innerContext, __innerProjection.__innerCountry6!!)
10583
}
10684

10785
override val actors: List<Actor> by lazy {
108-
if (__innerProjection.__innerActors7 == null) {
109-
error("Property [actors] is not available - add [actors] projection to switch on it")
110-
}
11186
__innerDto.resolveActors(__innerContext, __innerProjection.__innerActors7!!)
11287
}
11388

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/MutationImpl.kt.txt

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import kotlin.apply
4343
import kotlin.collections.MutableMap
4444
import kotlin.collections.Set
4545
import kotlin.collections.setOf
46-
import kotlin.error
4746
import kotlin.text.StringBuilder
4847
import kotlin.text.buildString
4948
import kotlin.text.isNotEmpty
@@ -57,56 +56,29 @@ internal class MutationImpl(
5756
internal val __innerDto: MutationDto,
5857
) : Mutation {
5958
override val createCountry: Country by lazy {
60-
if (__innerProjection.__innerCreateCountry0 == null) {
61-
error("Property [createCountry] is not available - add [createCountry] projection to switch on it")
62-
}
6359
__innerDto.resolveCreateCountry(__innerContext, __innerProjection.__innerCreateCountry0!!)
6460
}
6561

6662
override val createFilm: Film by lazy {
67-
if (__innerProjection.__innerCreateFilm1 == null) {
68-
error("Property [createFilm] is not available - add [createFilm] projection to switch on it")
69-
}
7063
__innerDto.resolveCreateFilm(__innerContext, __innerProjection.__innerCreateFilm1!!)
7164
}
7265

7366
override val createActor: Actor by lazy {
74-
if (__innerProjection.__innerCreateActor2 == null) {
75-
error("Property [createActor] is not available - add [createActor] projection to switch on it")
76-
}
7767
__innerDto.resolveCreateActor(__innerContext, __innerProjection.__innerCreateActor2!!)
7868
}
7969

8070
override val updateBirthday: Actor? by lazy {
81-
if (__innerProjection.__innerUpdateBirthday3 == null) {
82-
error("Property [updateBirthday] is not available - add [updateBirthday] projection to switch on it")
83-
}
8471
__innerDto.resolveUpdateBirthday(__innerContext, __innerProjection.__innerUpdateBirthday3!!)
8572
}
8673

8774
override val associate: Boolean
88-
get() {
89-
if (!__innerProjection.__innerAssociate4) {
90-
error("Property [associate] is not available - add [associate] projection to switch on it")
91-
}
92-
return __innerDto.associate!!
93-
}
75+
get() = __innerDto.associate!!
9476

9577
override val tagFilm: Boolean
96-
get() {
97-
if (!__innerProjection.__innerTagFilm5) {
98-
error("Property [tagFilm] is not available - add [tagFilm] projection to switch on it")
99-
}
100-
return __innerDto.tagFilm!!
101-
}
78+
get() = __innerDto.tagFilm!!
10279

10380
override val tagActor: Boolean
104-
get() {
105-
if (!__innerProjection.__innerTagActor6) {
106-
error("Property [tagActor] is not available - add [tagActor] projection to switch on it")
107-
}
108-
return __innerDto.tagActor!!
109-
}
81+
get() = __innerDto.tagActor!!
11082

11183
@Suppress("UNUSED_PARAMETER", "UNUSED_CHANGED_VALUE", "KotlinConstantConditions")
11284
override fun toString(): String = buildString {

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/QueryImpl.kt.txt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import kotlin.collections.Set
4848
import kotlin.collections.listOf
4949
import kotlin.collections.map
5050
import kotlin.collections.setOf
51-
import kotlin.error
5251
import kotlin.text.StringBuilder
5352
import kotlin.text.buildString
5453
import kotlin.text.isNotEmpty
@@ -62,51 +61,30 @@ internal class QueryImpl(
6261
internal val __innerDto: QueryDto,
6362
) : Query {
6463
override val country: Country? by lazy {
65-
if (__innerProjection.__innerCountry0 == null) {
66-
error("Property [country] is not available - add [country] projection to switch on it")
67-
}
6864
__innerDto.resolveCountry(__innerContext, __innerProjection.__innerCountry0!!)
6965
}
7066

7167
override val countries: List<Country> by lazy {
72-
if (__innerProjection.__innerCountries1 == null) {
73-
error("Property [countries] is not available - add [countries] projection to switch on it")
74-
}
7568
__innerDto.resolveCountries(__innerContext, __innerProjection.__innerCountries1!!)
7669
}
7770

7871
override val film: Film? by lazy {
79-
if (__innerProjection.__innerFilm2 == null) {
80-
error("Property [film] is not available - add [film] projection to switch on it")
81-
}
8272
__innerDto.resolveFilm(__innerContext, __innerProjection.__innerFilm2!!)
8373
}
8474

8575
override val films: List<Film> by lazy {
86-
if (__innerProjection.__innerFilms3 == null) {
87-
error("Property [films] is not available - add [films] projection to switch on it")
88-
}
8976
__innerDto.resolveFilms(__innerContext, __innerProjection.__innerFilms3!!)
9077
}
9178

9279
override val actor: Actor? by lazy {
93-
if (__innerProjection.__innerActor4 == null) {
94-
error("Property [actor] is not available - add [actor] projection to switch on it")
95-
}
9680
__innerDto.resolveActor(__innerContext, __innerProjection.__innerActor4!!)
9781
}
9882

9983
override val actors: List<Actor> by lazy {
100-
if (__innerProjection.__innerActors5 == null) {
101-
error("Property [actors] is not available - add [actors] projection to switch on it")
102-
}
10384
__innerDto.resolveActors(__innerContext, __innerProjection.__innerActors5!!)
10485
}
10586

10687
override val taggable: List<Taggable> by lazy {
107-
if (__innerProjection.__innerTaggable6 == null) {
108-
error("Property [taggable] is not available - add [taggable] projection to switch on it")
109-
}
11088
__innerDto.resolveTaggable(__innerContext, __innerProjection.__innerTaggable6!!)
11189
}
11290

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/SubscriptionImpl.kt.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import kotlin.apply
3434
import kotlin.collections.MutableMap
3535
import kotlin.collections.Set
3636
import kotlin.collections.setOf
37-
import kotlin.error
3837
import kotlin.text.StringBuilder
3938
import kotlin.text.buildString
4039
import kotlin.text.isNotEmpty
@@ -47,23 +46,14 @@ internal class SubscriptionImpl(
4746
internal val __innerDto: SubscriptionDto,
4847
) : Subscription {
4948
override val countryCreated: Country by lazy {
50-
if (__innerProjection.__innerCountryCreated0 == null) {
51-
error("Property [countryCreated] is not available - add [countryCreated] projection to switch on it")
52-
}
5349
__innerDto.resolveCountryCreated(__innerContext, __innerProjection.__innerCountryCreated0!!)
5450
}
5551

5652
override val filmCreated: Film by lazy {
57-
if (__innerProjection.__innerFilmCreated1 == null) {
58-
error("Property [filmCreated] is not available - add [filmCreated] projection to switch on it")
59-
}
6053
__innerDto.resolveFilmCreated(__innerContext, __innerProjection.__innerFilmCreated1!!)
6154
}
6255

6356
override val actorCreated: Actor by lazy {
64-
if (__innerProjection.__innerActorCreated2 == null) {
65-
error("Property [actorCreated] is not available - add [actorCreated] projection to switch on it")
66-
}
6757
__innerDto.resolveActorCreated(__innerContext, __innerProjection.__innerActorCreated2!!)
6858
}
6959

kobby-gradle-plugin/src/test/resources/io/github/ermadmi78/kobby/testcases/disable_projection_checking/expected/io/github/ermadmi78/kobby/testcases/disable_projection_checking/kobby/kotlin/entity/impl/TagImpl.kt.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import kotlin.Suppress
2525
import kotlin.collections.MutableMap
2626
import kotlin.collections.Set
2727
import kotlin.collections.setOf
28-
import kotlin.error
2928
import kotlin.text.StringBuilder
3029
import kotlin.text.buildString
3130
import kotlinx.serialization.json.JsonElement
@@ -36,12 +35,7 @@ internal class TagImpl(
3635
internal val __innerDto: TagDto,
3736
) : Tag {
3837
override val `value`: String
39-
get() {
40-
if (!__innerProjection.__innerValue0) {
41-
error("Property [value] is not available - add [value] projection to switch on it")
42-
}
43-
return __innerDto.`value`!!
44-
}
38+
get() = __innerDto.`value`!!
4539

4640
@Suppress("UNUSED_PARAMETER", "UNUSED_CHANGED_VALUE", "KotlinConstantConditions")
4741
override fun toString(): String = buildString {

0 commit comments

Comments
 (0)