Search in sources :

Example 1 with CustomCommand

use of com.spectralogic.ds3autogen.java.models.CustomCommand in project ds3_autogen by SpectraLogic.

the class ClientConverter_Test method toCustomCommand_Test.

@Test
public void toCustomCommand_Test() {
    final CustomCommand result = toCustomCommand(getRequestAmazonS3GetObject(), getTestDocSpec());
    assertThat(result.getName(), is("GetObjectHandler"));
}
Also used : CustomCommand(com.spectralogic.ds3autogen.java.models.CustomCommand) Test(org.junit.Test)

Example 2 with CustomCommand

use of com.spectralogic.ds3autogen.java.models.CustomCommand in project ds3_autogen by SpectraLogic.

the class ClientConverter_Test method toGetObjectAmazonS3CustomCommand_Test.

@Test
public void toGetObjectAmazonS3CustomCommand_Test() {
    final String expectedDocs = "/**\n" + "     * This is how you use get object\n" + "     */";
    final String expectedBody = "return new GetObjectResponseHandlerParser(\n" + "                request.getChannel(),\n" + "                this.netClient.getConnectionDetails().getBufferSize(),\n" + "                request.getObjectName())\n" + "                .response(this.netClient.getResponse(request));";
    final CustomCommand result = toGetObjectAmazonS3CustomCommand(getRequestAmazonS3GetObject(), getTestDocSpec());
    assertThat(result.getName(), is("GetObjectHandler"));
    assertThat(result.getRequestName(), is("GetObjectRequestHandler"));
    assertThat(result.getResponseName(), is("GetObjectResponseHandler"));
    assertThat(result.getDocumentation(), is(expectedDocs));
    assertThat(result.getAnnotationInfo(), is(nullValue()));
    assertThat(result.getCustomBody(), is(expectedBody));
}
Also used : CustomCommand(com.spectralogic.ds3autogen.java.models.CustomCommand) Test(org.junit.Test)

Aggregations

CustomCommand (com.spectralogic.ds3autogen.java.models.CustomCommand)2 Test (org.junit.Test)2