|
| 1 | +/* |
| 2 | + * Copyright 2017-2020 original authors |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package io.micronaut.data.jdbc.h2 |
| 17 | + |
| 18 | + |
| 19 | +import io.micronaut.test.extensions.spock.annotation.MicronautTest |
| 20 | +import jakarta.inject.Inject |
| 21 | +import spock.lang.Specification |
| 22 | + |
| 23 | +@MicronautTest |
| 24 | +@H2DBProperties |
| 25 | +class H2MappedEntitySpec extends Specification { |
| 26 | + @Inject |
| 27 | + H2DoubleImplement1Repository di1 |
| 28 | + @Inject |
| 29 | + H2DoubleImplement2Repository di2 |
| 30 | + @Inject |
| 31 | + H2DoubleImplement3Repository di3 |
| 32 | + |
| 33 | + void "test mapped entities with multiple interfaces"() { |
| 34 | + when: "First implementation" |
| 35 | + def results1 = di1.get() |
| 36 | + |
| 37 | + then: "The result is correct" |
| 38 | + results1 != null |
| 39 | + |
| 40 | + when: "Second implementation" |
| 41 | + def results2 = di2.get() |
| 42 | + |
| 43 | + then: "The result is correct" |
| 44 | + results2 != null |
| 45 | + |
| 46 | + when: "Second implementation" |
| 47 | + def results3 = di3.get() |
| 48 | + |
| 49 | + then: "The result is correct" |
| 50 | + results3 != null |
| 51 | + } |
| 52 | +} |
0 commit comments