Search in sources :

Example 1 with Command

use of com.spectralogic.ds3autogen.go.models.client.Command in project ds3_autogen by SpectraLogic.

the class BaseClientGenerator_Test method toCommandList_HttpRedirectFalse_Test.

@Test
public void toCommandList_HttpRedirectFalse_Test() {
    final ImmutableList<Command> expected = ImmutableList.of(new Command("DeleteBucketHandler"), new Command("CreateGetJobHandler"));
    final ImmutableList<Ds3Request> requests = ImmutableList.of(getBucketsRequest(), deleteBucketRequest(), getObjectsDetailsRequest(), getRequestBulkGet());
    final ImmutableList<Command> result = generator.toCommandList(requests, false);
    assertThat(result.size(), is(expected.size()));
    expected.forEach(cmd -> assertThat(result, hasItem(cmd)));
}
Also used : Command(com.spectralogic.ds3autogen.go.models.client.Command) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Example 2 with Command

use of com.spectralogic.ds3autogen.go.models.client.Command in project ds3_autogen by SpectraLogic.

the class BaseClientGenerator_Test method toCommand_Test.

@Test
public void toCommand_Test() {
    final Command expected = new Command("GetBucketHandler");
    assertThat(generator.toCommand(getBucketRequest()), is(expected));
}
Also used : Command(com.spectralogic.ds3autogen.go.models.client.Command) Test(org.junit.Test)

Example 3 with Command

use of com.spectralogic.ds3autogen.go.models.client.Command in project ds3_autogen by SpectraLogic.

the class BaseClientGenerator_Test method toCommandList_HttpRedirectTrue_Test.

@Test
public void toCommandList_HttpRedirectTrue_Test() {
    final ImmutableList<Command> expected = ImmutableList.of(new Command("GetBucketsHandler"), new Command("GetObjectsHandler"));
    final ImmutableList<Ds3Request> requests = ImmutableList.of(getBucketsRequest(), deleteBucketRequest(), getObjectsDetailsRequest(), getRequestBulkGet());
    final ImmutableList<Command> result = generator.toCommandList(requests, true);
    assertThat(result.size(), is(expected.size()));
    expected.forEach(cmd -> assertThat(result, hasItem(cmd)));
}
Also used : Command(com.spectralogic.ds3autogen.go.models.client.Command) Ds3Request(com.spectralogic.ds3autogen.api.models.apispec.Ds3Request) Test(org.junit.Test)

Aggregations

Command (com.spectralogic.ds3autogen.go.models.client.Command)3 Test (org.junit.Test)3 Ds3Request (com.spectralogic.ds3autogen.api.models.apispec.Ds3Request)2