use of com.spectralogic.ds3autogen.java.models.RequestConstructor in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method splitUuidConstructor_NoUuid_Test.
@Test
public void splitUuidConstructor_NoUuid_Test() {
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("String", "StringArg"), new Arguments("int", "IntArg"));
final RequestConstructor constructor = new RequestConstructor(args, args, argsToQueryParams(args), "");
final ImmutableList<RequestConstructor> result = splitUuidConstructor(constructor);
assertThat(result.size(), is(1));
}
use of com.spectralogic.ds3autogen.java.models.RequestConstructor in project ds3_autogen by SpectraLogic.
the class BaseRequestGenerator_Test method splitAllUuidConstructors_Test.
@Test
public void splitAllUuidConstructors_Test() {
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("String", "StringArg"), new Arguments("UUID", "UuidArg"), new Arguments("int", "IntArg"));
final RequestConstructor constructor = new RequestConstructor(args, args, argsToQueryParams(args), "");
final ImmutableList<RequestConstructor> result = splitAllUuidConstructors(ImmutableList.of(constructor));
assertThat(result.size(), is(2));
assertThat(getAllArgumentTypes(result.get(0).getParameters()), hasItem("UUID"));
assertThat(getQueryParamTypes(result.get(0).getQueryParams()), hasItem("UUID"));
assertThat(getAllArgumentTypes(result.get(0).getAssignments()), hasItem("UUID"));
assertThat(getAllArgumentTypes(result.get(1).getParameters()), not(hasItem("UUID")));
assertThat(getQueryParamTypes(result.get(1).getQueryParams()), not(hasItem("UUID")));
assertThat(getAllArgumentTypes(result.get(1).getAssignments()), not(hasItem("UUID")));
}
use of com.spectralogic.ds3autogen.java.models.RequestConstructor 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.java.models.RequestConstructor in project ds3_autogen by SpectraLogic.
the class CommonRequestGeneratorUtils_Test method createInputStreamConstructor_Test.
@Test
public void createInputStreamConstructor_Test() {
final ImmutableList<Arguments> args = ImmutableList.of(new Arguments("Type1", "Arg1"));
final RequestConstructor result = createInputStreamConstructor(args, argsToQueryParams(args), "", new Ds3DocSpecEmptyImpl());
assertThat(result.getParameters().size(), is(2));
assertThat(result.getParameters().get(0).getName(), is("Arg1"));
assertThat(result.getParameters().get(1).getName(), is("Stream"));
assertThat(result.getAssignments().size(), is(2));
assertThat(result.getAssignments().get(0).getName(), is("Arg1"));
assertThat(result.getAssignments().get(1).getName(), is("Stream"));
assertThat(result.getQueryParams().size(), is(1));
assertThat(result.getQueryParams().get(0).getName(), is("Arg1"));
assertThat(result.getAdditionalLines().size(), is(0));
}
Aggregations