use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class BaseClientGenerator_Test method toVoidCommand_Test.
@Test
public void toVoidCommand_Test() throws IOException {
final Ds3Request request = createTestRequestWithResponseCodes("com.test.WithoutPayloadRequest", false);
final VoidCommand result = toVoidCommand(request, getTestDocSpec());
assertThat(result.getCommandName(), is("WithoutPayload"));
assertThat(result.getRequestName(), is("WithoutPayloadRequest"));
assertThat(result.getResponseType(), is("void"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class Ds3SpecParserImpl_Test method SingleRequestHandler.
@Test
public void SingleRequestHandler() throws IOException {
final Ds3SpecParser parser = new Ds3SpecParserImpl();
final Ds3ApiSpec spec = parser.getSpec(Ds3SpecParserImpl_Test.class.getResourceAsStream("/specs/singleRequestHandler.xml"));
assertThat(spec, is(notNullValue()));
assertThat(spec.getRequests().size(), is(1));
final Ds3Request ds3Request = spec.getRequests().get(0);
assertThat(ds3Request.getName(), is("com.spectralogic.s3.server.handler.reqhandler.amazons3.GetObjectRequest"));
assertThat(ds3Request.getHttpVerb(), is(HttpVerb.GET));
assertThat(ds3Request.getClassification(), is(Classification.amazons3));
assertThat(ds3Request.getBucketRequirement(), is(Requirement.REQUIRED));
assertThat(ds3Request.getObjectRequirement(), is(Requirement.REQUIRED));
assertThat(ds3Request.getAction(), is(nullValue()));
assertThat(ds3Request.getResource(), is(nullValue()));
assertThat(ds3Request.getResourceType(), is(nullValue()));
assertThat(ds3Request.getOperation(), is(nullValue()));
assertThat(ds3Request.getDs3ResponseCodes().size(), is(1));
assertThat(ds3Request.getDs3ResponseCodes().get(0).getCode(), is(200));
assertThat(ds3Request.getDs3ResponseCodes().get(0).getDs3ResponseTypes().size(), is(1));
assertThat(ds3Request.getDs3ResponseCodes().get(0).getDs3ResponseTypes().get(0).getType(), is("java.lang.String"));
assertThat(ds3Request.getDs3ResponseCodes().get(0).getDs3ResponseTypes().get(0).getComponentType(), is(nullValue()));
assertThat(ds3Request.getOptionalQueryParams().size(), is(0));
assertThat(ds3Request.getRequiredQueryParams().size(), is(1));
assertThat(ds3Request.getRequiredQueryParams().get(0).getName(), is("Id"));
assertThat(ds3Request.getRequiredQueryParams().get(0).getType(), is("java.util.UUID"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class NotificationRequestGenerator_Test method toConstructorList_Test.
@Test
public void toConstructorList_Test() {
final Ds3Request request = getRequestDeleteNotification();
final ImmutableList<RequestConstructor> result = generator.toConstructorList(request, "", new Ds3DocSpecEmptyImpl());
assertThat(result.size(), is(1));
final RequestConstructor constructor = result.get(0);
assertThat(constructor.getAdditionalLines().size(), is(0));
assertThat(constructor.isDeprecated(), is(false));
final ImmutableList<Arguments> constructorParams = constructor.getParameters();
assertThat(constructorParams.size(), is(1));
assertThat(constructorParams.get(0).getName(), is("NotificationId"));
assertThat(constructor.getAssignments().size(), is(0));
assertThat(constructor.getQueryParams().size(), is(0));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class ObjectsRequestPayloadGenerator_Test method toConstructorArgumentsList_Test.
@Test
public void toConstructorArgumentsList_Test() {
final Ds3Request request = createSimpleTestDs3Request();
final ImmutableList<Arguments> result = generator.toConstructorArgumentsList(request);
assertThat(result.size(), is(6));
assertThat(result.get(0).getName(), is("BucketName"));
assertThat(result.get(1).getName(), is("ObjectName"));
assertThat(result.get(2).getName(), is("JobId"));
assertThat(result.get(3).getName(), is("Priority"));
assertThat(result.get(4).getName(), is("NotificationEndPoint"));
assertThat(result.get(5).getName(), is("Objects"));
assertThat(result.get(5).getType(), is("List<Ds3Object>"));
}
use of com.spectralogic.ds3autogen.api.models.apispec.Ds3Request in project ds3_autogen by SpectraLogic.
the class GetJobChunksReadyParserGenerator_Test method toResponseCodeList_Test.
@Test
public void toResponseCodeList_Test() {
final Ds3Request ds3Request = getJobChunksReadyForClientProcessingRequest();
final ImmutableList<ResponseCode> result = generator.toResponseCodeList(ds3Request.getDs3ResponseCodes(), "TestResponse", false);
assertThat(result.size(), is(1));
assertThat(result.get(0).getCode(), is(200));
}
Aggregations