Search in sources :

Example 21 with Operation

use of com.google.container.v1beta1.Operation in project ddf by codice.

the class CswFilterDelegateTest method getOperation.

private static Operation getOperation() {
    List<DomainType> getRecordsParameters = new ArrayList<>(6);
    DomainType typeName = new DomainType();
    typeName.setName(CswConstants.TYPE_NAME_PARAMETER);
    getRecordsParameters.add(typeName);
    DomainType outputSchema = new DomainType();
    outputSchema.setName(CswConstants.OUTPUT_SCHEMA_PARAMETER);
    getRecordsParameters.add(outputSchema);
    DomainType constraintLang = new DomainType();
    constraintLang.setName(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER);
    getRecordsParameters.add(constraintLang);
    DomainType outputFormat = new DomainType();
    outputFormat.setName(CswConstants.OUTPUT_FORMAT_PARAMETER);
    getRecordsParameters.add(outputFormat);
    DomainType resultType = new DomainType();
    resultType.setName(CswConstants.RESULT_TYPE_PARAMETER);
    getRecordsParameters.add(resultType);
    DomainType elementSetName = new DomainType();
    elementSetName.setName(CswConstants.ELEMENT_SET_NAME_PARAMETER);
    getRecordsParameters.add(elementSetName);
    Operation getRecords = new Operation();
    getRecords.setName(CswConstants.GET_RECORDS);
    getRecords.setParameter(getRecordsParameters);
    List<Operation> operations = new ArrayList<>(1);
    operations.add(getRecords);
    return getRecords;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 22 with Operation

use of com.google.container.v1beta1.Operation in project ddf by codice.

the class CswCqlFilterTest method getOperation.

private static Operation getOperation() {
    List<DomainType> getRecordsParameters = new ArrayList<>(6);
    DomainType typeName = new DomainType();
    typeName.setName(CswConstants.TYPE_NAME_PARAMETER);
    getRecordsParameters.add(typeName);
    DomainType outputSchema = new DomainType();
    outputSchema.setName(CswConstants.OUTPUT_SCHEMA_PARAMETER);
    getRecordsParameters.add(outputSchema);
    DomainType constraintLang = new DomainType();
    constraintLang.setName(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER);
    getRecordsParameters.add(constraintLang);
    DomainType outputFormat = new DomainType();
    outputFormat.setName(CswConstants.OUTPUT_FORMAT_PARAMETER);
    getRecordsParameters.add(outputFormat);
    DomainType resultType = new DomainType();
    resultType.setName(CswConstants.RESULT_TYPE_PARAMETER);
    getRecordsParameters.add(resultType);
    DomainType elementSetName = new DomainType();
    elementSetName.setName(CswConstants.ELEMENT_SET_NAME_PARAMETER);
    getRecordsParameters.add(elementSetName);
    Operation getRecords = new Operation();
    getRecords.setName(CswConstants.GET_RECORDS);
    getRecords.setParameter(getRecordsParameters);
    List<Operation> operations = new ArrayList<>(1);
    operations.add(getRecords);
    return getRecords;
}
Also used : DomainType(net.opengis.ows.v_1_0_0.DomainType) ArrayList(java.util.ArrayList) Operation(net.opengis.ows.v_1_0_0.Operation)

Example 23 with Operation

use of com.google.container.v1beta1.Operation in project ets-ogcapi-edr10 by opengeospatial.

the class CollectionsTime method zParameterDefinition.

/**
 * Abstract Test 40 (/conf/edr/rc-z-definition): Validate that the vertical level query parameters are constructed correctly. (position)
 * Abstract Test 56 (/conf/edr/rc-z-definition): Validate that the vertical level query parameters are constructed correctly. (area)
 *
 * @param testPoint the testPoint under test, never <code>null</code>
 * @param model api definition, never <code>null</code>
 */
public void zParameterDefinition(TestPoint testPoint, OpenApi3 model) {
    Parameter z = null;
    String paramName = "z";
    for (Path path : model.getPaths().values()) {
        if (testPoint.getPath().equals(path.getPathString())) {
            for (Operation op : path.getOperations().values()) {
                for (Parameter param : op.getParameters()) {
                    if (hasName(param)) {
                        if (param.getName().equals(paramName)) {
                            z = param;
                        }
                    }
                }
            }
        }
    }
    if (z != null) {
        String msg = "Expected property '%s' with value '%s' but was '%s'";
        assertEquals(z.getName(), paramName, String.format(msg, "name", paramName, z.getName()));
        assertEquals(z.getIn(), "query", String.format(msg, "in", "query", z.getIn()));
        assertTrue(isRequired(z), String.format(msg, "required", "true", z.getRequired()));
        assertEquals(z.getStyle(), "form", String.format(msg, "style", "form", z.getStyle()));
        assertFalse(isExplode(z), String.format(msg, "explode", "false", z.getExplode()));
    }
}
Also used : Path(com.reprezen.kaizen.oasparser.model3.Path) Parameter(com.reprezen.kaizen.oasparser.model3.Parameter) Operation(com.reprezen.kaizen.oasparser.model3.Operation)

Example 24 with Operation

use of com.google.container.v1beta1.Operation in project ets-ogcapi-edr10 by opengeospatial.

the class CollectionsTime method resolutionxParameterDefinition.

/**
 * <pre>
 * Requirement A.25: /req/edr/resolution-x-definition Parameter resolution-x
 * definition
 * </pre>
 * NOTE: Not referenced by ATS
 *
 * @param testPoint the testPoint under test, never <code>null</code>
 * @param model api definition, never <code>null</code>
 */
public void resolutionxParameterDefinition(TestPoint testPoint, OpenApi3 model) {
    Parameter resolutionx = null;
    String paramName = "resolution-x";
    for (Path path : model.getPaths().values()) {
        if (testPoint.getPath().equals(path.getPathString())) {
            for (Operation op : path.getOperations().values()) {
                for (Parameter param : op.getParameters()) {
                    if (hasName(param)) {
                        if (param.getName().equals(paramName)) {
                            resolutionx = param;
                        }
                    }
                }
            }
        }
    }
    if (resolutionx != null) {
        String msg = "Expected property '%s' with value '%s' but was '%s'";
        assertEquals(resolutionx.getName(), paramName, String.format(msg, "name", paramName, resolutionx.getName()));
        assertEquals(resolutionx.getIn(), "query", String.format(msg, "in", "query", resolutionx.getIn()));
        assertFalse(isRequired(resolutionx), String.format(msg, "required", "false", resolutionx.getRequired()));
        assertEquals(resolutionx.getStyle(), "form", String.format(msg, "style", "form", resolutionx.getStyle()));
        assertFalse(isExplode(resolutionx), String.format(msg, "explode", "false", resolutionx.getExplode()));
    }
}
Also used : Path(com.reprezen.kaizen.oasparser.model3.Path) Parameter(com.reprezen.kaizen.oasparser.model3.Parameter) Operation(com.reprezen.kaizen.oasparser.model3.Operation)

Example 25 with Operation

use of com.google.container.v1beta1.Operation in project ets-ogcapi-edr10 by opengeospatial.

the class CollectionsTime method withinParameterDefinition.

/**
 * <pre>
 * Requirement A.21: /req/edr/within-definition Parameter within definition
 * </pre>
 * NOTE: Not referenced by ATS
 *
 * @param testPoint the testPoint under test, never <code>null</code>
 * @param model api definition, never <code>null</code>
 */
public void withinParameterDefinition(TestPoint testPoint, OpenApi3 model) {
    // Based on
    // https://github.com/RepreZen/KaiZen-OpenApi-Parser/blob/master/GettingStarted.md
    Parameter within = null;
    String paramName = "within";
    for (Path path : model.getPaths().values()) {
        if (testPoint.getPath().equals(path.getPathString())) {
            for (Operation op : path.getOperations().values()) {
                for (Parameter param : op.getParameters()) {
                    if (hasName(param)) {
                        if (param.getName().equals(paramName)) {
                            within = param;
                        }
                    }
                }
            }
        }
    }
    if (within != null) {
        String msg = "Expected property '%s' with value '%s' but was '%s'";
        assertEquals(within.getName(), paramName, String.format(msg, "name", paramName, within.getName()));
        assertEquals(within.getIn(), "query", String.format(msg, "in", "query", within.getIn()));
        assertFalse(isRequired(within), String.format(msg, "required", "false", within.getRequired()));
        assertEquals(within.getStyle(), "form", String.format(msg, "style", "form", within.getStyle()));
        assertFalse(isExplode(within), String.format(msg, "explode", "false", within.getExplode()));
    }
}
Also used : Path(com.reprezen.kaizen.oasparser.model3.Path) Parameter(com.reprezen.kaizen.oasparser.model3.Parameter) Operation(com.reprezen.kaizen.oasparser.model3.Operation)

Aggregations

ArrayList (java.util.ArrayList)81 Test (org.junit.Test)75 AbstractMessage (com.google.protobuf.AbstractMessage)65 Operation (com.google.cloud.compute.v1.Operation)49 Operation (com.google.container.v1.Operation)43 StatusCondition (com.google.container.v1.StatusCondition)40 Operation (com.google.container.v1beta1.Operation)24 StatusCondition (com.google.container.v1beta1.StatusCondition)23 InstancesClient (com.google.cloud.compute.v1.InstancesClient)20 Operation (com.reprezen.kaizen.oasparser.model3.Operation)16 Path (com.reprezen.kaizen.oasparser.model3.Path)15 Operation (net.opengis.ows.v_1_0_0.Operation)15 Instance (com.google.cloud.compute.v1.Instance)13 Parameter (com.reprezen.kaizen.oasparser.model3.Parameter)13 DomainType (net.opengis.ows.v_1_0_0.DomainType)13 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)12 InsertInstanceRequest (com.google.cloud.compute.v1.InsertInstanceRequest)11 Operation (org.osate.aadl2.Operation)8 NetworkInterface (com.google.cloud.compute.v1.NetworkInterface)7 BooleanLiteral (org.osate.aadl2.BooleanLiteral)7