Search in sources :

Example 1 with SimpleVariable

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

the class RequiredObjectsPayloadGenerator_Test method toStructAssignmentParamsTest.

@Test
public void toStructAssignmentParamsTest() {
    final ImmutableList<VariableInterface> expected = ImmutableList.of(new SimpleVariable("bucketName"), new Variable("content", "buildDs3ObjectListStream(objects)"));
    final ImmutableList<VariableInterface> result = generator.toStructAssignmentParams(testRequest);
    assertThat(result.size(), is(expected.size()));
    expected.forEach(var -> assertThat(result, hasItem(var)));
}
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 2 with SimpleVariable

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

the class RequestGeneratorUtil_Test method toSimpleVariables_FullList_Test.

@Test
public void toSimpleVariables_FullList_Test() {
    final ImmutableList<SimpleVariable> expected = ImmutableList.of(new SimpleVariable("paramOne"), new SimpleVariable("paramTwo"), new SimpleVariable("paramThree"), new SimpleVariable("typeName"));
    final ImmutableList<Ds3Param> params = ImmutableList.of(new Ds3Param("ParamOne", "string", false), new Ds3Param("ParamTwo", "string", true), new Ds3Param("ParamThree", "string", false), new Ds3Param("Type", "com.test.TypeName", false));
    final ImmutableList<SimpleVariable> result = toSimpleVariables(params);
    assertThat(result.size(), is(expected.size()));
    expected.forEach(expectedVar -> assertThat(result, hasItem(expectedVar)));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) SimpleVariable(com.spectralogic.ds3autogen.go.models.request.SimpleVariable) Test(org.junit.Test)

Example 3 with SimpleVariable

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

the class PutObjectRequestGenerator_Test method toStructAssignmentParams_Test.

@Test
public void toStructAssignmentParams_Test() {
    final ImmutableList<VariableInterface> expectedVars = ImmutableList.of(new SimpleVariable("bucketName"), new SimpleVariable("objectName"), new SimpleVariable("content"), new Variable("checksum", "networking.NewNoneChecksum()"), new Variable("headers", "&http.Header{}"));
    final ImmutableList<VariableInterface> result = generator.toStructAssignmentParams(getRequestCreateObject());
    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 4 with SimpleVariable

use of com.spectralogic.ds3autogen.go.models.request.SimpleVariable 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)

Aggregations

SimpleVariable (com.spectralogic.ds3autogen.go.models.request.SimpleVariable)4 Test (org.junit.Test)4 Variable (com.spectralogic.ds3autogen.go.models.request.Variable)3 VariableInterface (com.spectralogic.ds3autogen.go.models.request.VariableInterface)3 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)1