Fixed the broken test
@@ -25,7 +25,9 @@ import spock.lang.Specification
import spock.lang.Unroll
import springfox.bean.validators.plugins.models.NullabilityTestModel
import springfox.documentation.builders.ModelPropertyBuilder
+import springfox.documentation.builders.PropertySpecificationBuilder
import springfox.documentation.spi.DocumentationType
+import springfox.documentation.spi.schema.contexts.ModelContext
import springfox.documentation.spi.schema.contexts.ModelPropertyContext
class ModelPropertyIsNullAnnotationPluginSpec extends Specification {
@@ -43,9 +45,10 @@ class ModelPropertyIsNullAnnotationPluginSpec extends Specification {
def element = NullabilityTestModel.getDeclaredField(propertyName)
def context = new ModelPropertyContext(
new ModelPropertyBuilder(),
+ new PropertySpecificationBuilder(propertyName),
element,
new TypeResolver(),
- DocumentationType.SWAGGER_12)
+ Mock(ModelContext))
when:
sut.apply(context)
@@ -71,7 +74,8 @@ class ModelPropertyIsNullAnnotationPluginSpec extends Specification {
new ModelPropertyBuilder(),
beanProperty,
new TypeResolver(),
- DocumentationType.SWAGGER_12)
+ Mock(ModelContext),
+ new PropertySpecificationBuilder(propertyName))
when:
sut.apply(context)
