Search in sources :

Example 36 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class RequestConverterUtil_Test method getRequiredArgsFromRequestHeader_Notification_Test.

@Test
public void getRequiredArgsFromRequestHeader_Notification_Test() {
    final Ds3Request ds3Request = new Ds3Request("RequestName", null, Classification.amazons3, Requirement.REQUIRED, Requirement.REQUIRED, null, Resource.GENERIC_DAO_NOTIFICATION_REGISTRATION, ResourceType.NON_SINGLETON, null, false, null, null, null);
    final ImmutableList<Arguments> result = getRequiredArgsFromRequestHeader(ds3Request);
    assertThat(result.size(), is(2));
    assertThat(result.get(0).getName(), is("BucketName"));
    assertThat(result.get(0).getType(), is("String"));
    assertThat(result.get(1).getName(), is("ObjectName"));
    assertThat(result.get(1).getType(), is("String"));
}
Also used : Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Example 37 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class RequestConverterUtil_Test method getRequiredArgsFromRequestHeader_Full_Test.

@Test
public void getRequiredArgsFromRequestHeader_Full_Test() {
    final Ds3Request ds3Request = new Ds3Request("RequestName", null, Classification.amazons3, Requirement.REQUIRED, Requirement.REQUIRED, null, Resource.JOB, null, null, true, null, null, null);
    final ImmutableList<Arguments> result = getRequiredArgsFromRequestHeader(ds3Request);
    assertThat(result.size(), is(3));
    assertThat(result.get(0).getName(), is("BucketName"));
    assertThat(result.get(0).getType(), is("String"));
    assertThat(result.get(1).getName(), is("ObjectName"));
    assertThat(result.get(1).getType(), is("String"));
    assertThat(result.get(2).getName(), is("JobId"));
    assertThat(result.get(2).getType(), is("UUID"));
}
Also used : Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Example 38 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method getRequestPath_BucketAndObject_Test.

@Test
public void getRequestPath_BucketAndObject_Test() {
    final String expectedPath = "\"/\" + this.bucketName + \"/\" + this.objectName";
    final Ds3Request request = createDs3RequestTestData("RequestName", Classification.amazons3, Requirement.REQUIRED, Requirement.REQUIRED);
    final String requestPath = getRequestPath(request);
    assertThat(requestPath, is(expectedPath));
}
Also used : RequestGeneratorTestHelper.createSimpleTestDs3Request(com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request) Ds3ModelPartialDataFixture.createEmptyDs3Request(com.spectralogic.ds3autogen.testutil.Ds3ModelPartialDataFixture.createEmptyDs3Request) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Example 39 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method toQueryParamsList_Test.

@Test
public void toQueryParamsList_Test() {
    final ImmutableList<Ds3Param> params = createTestDs3ParamList();
    final Ds3Request request = createDs3RequestTestData(true, null, params);
    final ImmutableList<QueryParam> result = generator.toQueryParamsList(request);
    assertThat(result.size(), is(4));
    assertThat(result.get(0).getName(), is("IgnoreNamingConflicts"));
    assertThat(result.get(1).getName(), is("MaxUploadSize"));
    assertThat(result.get(2).getName(), is("Name"));
    assertThat(result.get(3).getName(), is("Priority"));
}
Also used : Ds3Param(com.spectralogic.ds3autogen.api.models.apispec.Ds3Param) QueryParam(com.spectralogic.ds3autogen.java.models.QueryParam) RequestGeneratorTestHelper.createSimpleTestDs3Request(com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request) Ds3ModelPartialDataFixture.createEmptyDs3Request(com.spectralogic.ds3autogen.testutil.Ds3ModelPartialDataFixture.createEmptyDs3Request) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Example 40 with Ds3Request

use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.

the class BaseRequestGenerator_Test method getRequestPath_SpectraS3ResourceWithBucket_Test.

@Test
public void getRequestPath_SpectraS3ResourceWithBucket_Test() {
    final String expectedPath = "\"/_rest_/bucket/\" + this.bucketName";
    final Ds3Request request = createDs3RequestTestData("RequestName", Classification.spectrads3, Resource.BUCKET, null, true);
    final String requestPath = getRequestPath(request);
    assertThat(requestPath, is(expectedPath));
}
Also used : RequestGeneratorTestHelper.createSimpleTestDs3Request(com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request) Ds3ModelPartialDataFixture.createEmptyDs3Request(com.spectralogic.ds3autogen.testutil.Ds3ModelPartialDataFixture.createEmptyDs3Request) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Aggregations

Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)92 Test (org.junit.Test)76 RequestGeneratorTestHelper.createSimpleTestDs3Request (com.spectralogic.ds3autogen.java.test.helpers.RequestGeneratorTestHelper.createSimpleTestDs3Request)37 Arguments (com.spectralogic.ds3autogen.api.models.Arguments)24 Ds3ModelPartialDataFixture.createEmptyDs3Request (com.spectralogic.ds3autogen.testutil.Ds3ModelPartialDataFixture.createEmptyDs3Request)17 ImmutableList (com.google.common.collect.ImmutableList)11 Ds3Param (com.spectralogic.ds3autogen.api.models.apispec.Ds3Param)11 Ds3DocSpecEmptyImpl (com.spectralogic.ds3autogen.docspec.Ds3DocSpecEmptyImpl)9 QueryParam (com.spectralogic.ds3autogen.java.models.QueryParam)9 GuavaCollectors (com.spectralogic.ds3autogen.utils.collections.GuavaCollectors)8 RequestConstructor (com.spectralogic.ds3autogen.java.models.RequestConstructor)7 ConstructorParam (com.spectralogic.ds3autogen.python.model.request.ConstructorParam)7 Helper.camelToUnderscore (com.spectralogic.ds3autogen.utils.Helper.camelToUnderscore)7 CustomArgumentComparator (com.spectralogic.ds3autogen.utils.comparators.CustomArgumentComparator)7 RequestConverterUtil.getNonVoidArgsFromParamList (com.spectralogic.ds3autogen.utils.RequestConverterUtil.getNonVoidArgsFromParamList)6 Ds3ApiSpec (com.spectralogic.ds3autogen.api.models.apispec.Ds3ApiSpec)5 PythonHelper.pythonIndent (com.spectralogic.ds3autogen.python.helpers.PythonHelper.pythonIndent)5 Variable (com.spectralogic.ds3autogen.java.models.Variable)3 Ds3RequestClassificationUtil (com.spectralogic.ds3autogen.utils.Ds3RequestClassificationUtil)3 OutputStream (java.io.OutputStream)3