Search in sources :

Example 6 with Variable

use of com.spectralogic.ds3autogen.go.models.request.Variable in project ds3_autogen by SpectraLogic.

the class GetObjectRequestGenerator_Test method toStructAssignmentParams_Test.

@Test
public void toStructAssignmentParams_Test() {
    final ImmutableList<VariableInterface> expectedVars = ImmutableList.of(new SimpleVariable("bucketName"), new SimpleVariable("objectName"), new Variable("checksum", "networking.NewNoneChecksum()"));
    final ImmutableList<VariableInterface> result = generator.toStructAssignmentParams(getRequestAmazonS3GetObject());
    assertThat(result.size(), is(expectedVars.size()));
    expectedVars.forEach(expected -> assertThat(result, hasItem(expected)));
}
Also used : Variable(com.spectralogic.ds3autogen.go.models.request.Variable) SimpleVariable(com.spectralogic.ds3autogen.go.models.request.SimpleVariable) VariableInterface(com.spectralogic.ds3autogen.go.models.request.VariableInterface) SimpleVariable(com.spectralogic.ds3autogen.go.models.request.SimpleVariable) Test(org.junit.Test)

Example 7 with Variable

use of com.spectralogic.ds3autogen.go.models.request.Variable in project ds3_autogen by SpectraLogic.

the class MultipartUploadPayloadGenerator_Test method getStructAssignmentVariableTest.

@Test
public void getStructAssignmentVariableTest() {
    final Variable result = generator.getStructAssignmentVariable();
    assertThat(result.getName(), is("content"));
    assertThat(result.getAssignment(), is("buildPartsListStream(parts)"));
}
Also used : Variable(com.spectralogic.ds3autogen.go.models.request.Variable) Test(org.junit.Test)

Example 8 with Variable

use of com.spectralogic.ds3autogen.go.models.request.Variable in project ds3_autogen by SpectraLogic.

the class RequestGeneratorUtil_Test method toQueryParamVarList_FullList_Test.

@Test
public void toQueryParamVarList_FullList_Test() {
    final ImmutableList<Variable> expected = ImmutableList.of(new Variable("param_one", "strconv.Itoa(paramOne)"), new Variable("param_two", "strconv.FormatFloat(paramTwo, 'f', -1, 64)"), new Variable("param_three", "paramThree"), new Variable("param_four", "\"\""), new Variable("type", "typeName.String()"));
    final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("ParamOne", "int", false), new Ds3Param("ParamTwo", "float64", false), new Ds3Param("ParamThree", "string", false), new Ds3Param("ParamFour", "void", false), new Ds3Param("Operation", "RestOperationType", false), new Ds3Param("Type", "com.test.TypeName", false));
    final ImmutableList<Variable> result = toQueryParamVarList(params);
    assertThat(result.size(), is(expected.size()));
    for (int i = 0; i < result.size(); i++) {
        assertThat(result.get(i), is(expected.get(i)));
    }
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) Variable(com.spectralogic.ds3autogen.go.models.request.Variable) SimpleVariable(com.spectralogic.ds3autogen.go.models.request.SimpleVariable) Test(org.junit.Test)

Example 9 with Variable

use of com.spectralogic.ds3autogen.go.models.request.Variable in project ds3_autogen by SpectraLogic.

the class RequiredObjectsPayloadGenerator_Test method getStructAssignmentVariableTest.

@Test
public void getStructAssignmentVariableTest() {
    final Variable result = generator.getStructAssignmentVariable();
    assertThat(result.getName(), is("content"));
    assertThat(result.getAssignment(), is("buildDs3ObjectListStream(objects)"));
}
Also used : Variable(com.spectralogic.ds3autogen.go.models.request.Variable) SimpleVariable(com.spectralogic.ds3autogen.go.models.request.SimpleVariable) Test(org.junit.Test)

Example 10 with Variable

use of com.spectralogic.ds3autogen.go.models.request.Variable in project ds3_autogen by SpectraLogic.

the class StringRequestPayloadGenerator_Test method getStructAssignmentVariableTest.

@Test
public void getStructAssignmentVariableTest() {
    final Variable result = generator.getStructAssignmentVariable();
    assertThat(result.getName(), is("content"));
    assertThat(result.getAssignment(), is("buildStreamFromString(requestPayload)"));
}
Also used : Variable(com.spectralogic.ds3autogen.go.models.request.Variable) Test(org.junit.Test)

Aggregations

Variable (com.spectralogic.ds3autogen.go.models.request.Variable)10 Test (org.junit.Test)10 SimpleVariable (com.spectralogic.ds3autogen.go.models.request.SimpleVariable)6 VariableInterface (com.spectralogic.ds3autogen.go.models.request.VariableInterface)3 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)2