Search in sources :

Example 91 with Test

use of org.testng.annotations.Test in project swagger-core by swagger-api.

the class ParameterSerializationTest method deserializeIntegerArrayPathParameter.

@Test(description = "it should deserialize a PathParameter with integer array ")
public void deserializeIntegerArrayPathParameter() throws IOException {
    final String json = "{" + "   \"in\":\"path\"," + "   \"required\":true," + "   \"type\":\"array\"," + "   \"items\":{" + "      \"type\":\"integer\"," + "      \"format\":\"int32\"" + "   }," + "   \"collectionFormat\":\"multi\"" + "}";
    final Parameter p = m.readValue(json, Parameter.class);
    SerializationMatchers.assertEqualsToJson(p, json);
}
Also used : BodyParameter(io.swagger.models.parameters.BodyParameter) PathParameter(io.swagger.models.parameters.PathParameter) Parameter(io.swagger.models.parameters.Parameter) QueryParameter(io.swagger.models.parameters.QueryParameter) HeaderParameter(io.swagger.models.parameters.HeaderParameter) Test(org.testng.annotations.Test)

Example 92 with Test

use of org.testng.annotations.Test in project swagger-core by swagger-api.

the class ParameterSerializationTest method testReadOnlyParameter.

@Test(description = "should mark a parameter as readOnly")
public void testReadOnlyParameter() throws Exception {
    final QueryParameter qp = new QueryParameter().readOnly(true);
    final String json = "{\"in\":\"query\",\"required\":false,\"readOnly\":true}";
    SerializationMatchers.assertEqualsToJson(qp, json);
}
Also used : QueryParameter(io.swagger.models.parameters.QueryParameter) Test(org.testng.annotations.Test)

Example 93 with Test

use of org.testng.annotations.Test in project swagger-core by swagger-api.

the class ParameterSerializationTest method deserializeEnumPathParameter.

@Test(description = "it should deserialize a path parameter with enum")
public void deserializeEnumPathParameter() throws IOException {
    final String json = "{" + "   \"in\":\"path\"," + "   \"required\":true," + "   \"items\":{" + "      \"type\":\"string\"" + "   }," + "   \"enum\":[\"a\",\"b\",\"c\"]" + "}";
    final Parameter p = m.readValue(json, Parameter.class);
    SerializationMatchers.assertEqualsToJson(p, json);
    assertEquals(((PathParameter) p).getEnum(), Arrays.asList("a", "b", "c"));
}
Also used : BodyParameter(io.swagger.models.parameters.BodyParameter) PathParameter(io.swagger.models.parameters.PathParameter) Parameter(io.swagger.models.parameters.Parameter) QueryParameter(io.swagger.models.parameters.QueryParameter) HeaderParameter(io.swagger.models.parameters.HeaderParameter) Test(org.testng.annotations.Test)

Example 94 with Test

use of org.testng.annotations.Test in project swagger-core by swagger-api.

the class ParameterSerializationTest method deserializeStringArrayPathParameter.

@Test(description = "it should deserialize a PathParameter with string array")
public void deserializeStringArrayPathParameter() throws IOException {
    final String json = "{" + "   \"in\":\"path\"," + "   \"required\":true," + "   \"type\":\"array\"," + "   \"items\":{" + "      \"type\":\"string\"" + "   }," + "   \"collectionFormat\":\"multi\"" + "}";
    final Parameter p = m.readValue(json, Parameter.class);
    SerializationMatchers.assertEqualsToJson(p, json);
}
Also used : BodyParameter(io.swagger.models.parameters.BodyParameter) PathParameter(io.swagger.models.parameters.PathParameter) Parameter(io.swagger.models.parameters.Parameter) QueryParameter(io.swagger.models.parameters.QueryParameter) HeaderParameter(io.swagger.models.parameters.HeaderParameter) Test(org.testng.annotations.Test)

Example 95 with Test

use of org.testng.annotations.Test in project swagger-core by swagger-api.

the class ParameterSerializationTest method deserializeQueryParameter.

@Test(description = "it should deserialize a QueryParameter")
public void deserializeQueryParameter() throws IOException {
    final String json = "{\"in\":\"query\",\"required\":false,\"type\":\"string\"}";
    final Parameter p = m.readValue(json, Parameter.class);
    SerializationMatchers.assertEqualsToJson(p, json);
}
Also used : BodyParameter(io.swagger.models.parameters.BodyParameter) PathParameter(io.swagger.models.parameters.PathParameter) Parameter(io.swagger.models.parameters.Parameter) QueryParameter(io.swagger.models.parameters.QueryParameter) HeaderParameter(io.swagger.models.parameters.HeaderParameter) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)27231 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2438 Task (com.evolveum.midpoint.task.api.Task)2069 ArrayList (java.util.ArrayList)1583 File (java.io.File)1530 BaseTest (org.broadinstitute.hellbender.utils.test.BaseTest)1188 HashMap (java.util.HashMap)1134 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)1078 BeforeTest (org.testng.annotations.BeforeTest)870 Issue (io.qameta.allure.Issue)857 CommandLineProgramTest (org.broadinstitute.hellbender.CommandLineProgramTest)814 List (java.util.List)748 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)692 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)690 Response (javax.ws.rs.core.Response)682 ODocument (com.orientechnologies.orient.core.record.impl.ODocument)651 HashSet (java.util.HashSet)631 BigDecimal (java.math.BigDecimal)627 Parameters (org.testng.annotations.Parameters)608 BaseTest (org.xdi.oxauth.BaseTest)582