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"));
}
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"));
}
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));
}
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"));
}
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));
}
Aggregations