/** * @see SaveImageOptions#withDescription(String) */ public static SaveImageOptions withDescription(String description) { SaveImageOptions options = new SaveImageOptions(); return options.withDescription(description); } }
/** * @see SaveImageOptions#withDescription(String) */ public static SaveImageOptions withDescription(String description) { SaveImageOptions options = new SaveImageOptions(); return options.withDescription(description); } }
/** * @see SaveImageOptions#withDescription(String) */ public static SaveImageOptions withDescription(String description) { SaveImageOptions options = new SaveImageOptions(); return options.withDescription(description); } }
/** * @see SaveImageOptions#withDescription(String) */ public static SaveImageOptions withDescription(String description) { SaveImageOptions options = new SaveImageOptions(); return options.withDescription(description); } }
/** * @see SaveImageOptions#withDescription(String) */ public static SaveImageOptions withDescription(String description) { SaveImageOptions options = new SaveImageOptions(); return options.withDescription(description); } }
@Test(expectedExceptions = IllegalArgumentException.class) public void testWith501LengthDescription() { SaveImageOptions options = new SaveImageOptions(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < 1 * 501; i++) builder.append('a'); String description = builder.toString(); options.withDescription(description); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testWith501LengthDescription() { SaveImageOptions options = new SaveImageOptions(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < 1 * 501; i++) builder.append('a'); String description = builder.toString(); options.withDescription(description); }
@Test public void testWithDescription() { SaveImageOptions options = new SaveImageOptions(); options.withDescription("test"); assertEquals(options.buildQueryParameters().get("description"), ImmutableList.of("test")); }
@Test public void testWith500LengthDescription() { SaveImageOptions options = new SaveImageOptions(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < 1 * 500; i++) builder.append('a'); String description = builder.toString(); options.withDescription(description); assertEquals(options.buildQueryParameters().get("description"), ImmutableList.of(description)); }
@Test public void testWith500LengthDescription() { SaveImageOptions options = new SaveImageOptions(); StringBuilder builder = new StringBuilder(); for (int i = 0; i < 1 * 500; i++) builder.append('a'); String description = builder.toString(); options.withDescription(description); assertEquals(options.buildQueryParameters().get("description"), ImmutableList.of(description)); }
@Test public void testWithDescription() { SaveImageOptions options = new SaveImageOptions(); options.withDescription("test"); assertEquals(options.buildQueryParameters().get("description"), ImmutableList.of("test")); }
@Test public void testSaveImageOptions() throws NoSuchMethodException, IOException { Invokable<?, ?> method = method(GridImageAsyncClient.class, "saveImageFromServer", String.class, String.class, SaveImageOptions[].class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("friendly", "serverName", new SaveImageOptions().withDescription("fooy"))); assertRequestLineEquals( httpRequest, "GET https://api.gogrid.com/api/grid/image/save?v=1.5&friendlyName=friendly&server=serverName&description=fooy HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, ""); assertPayloadEquals(httpRequest, null, null, false); assertResponseParserClassEquals(method, httpRequest, ParseImageFromJsonResponse.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, null); } }
@Test public void testSaveImageOptions() throws NoSuchMethodException, IOException { Invokable<?, ?> method = method(GridImageApi.class, "saveImageFromServer", String.class, String.class, SaveImageOptions[].class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of("friendly", "serverName", new SaveImageOptions().withDescription("fooy"))); assertRequestLineEquals( httpRequest, "GET https://api.gogrid.com/api/grid/image/save?v=1.5&friendlyName=friendly&server=serverName&description=fooy HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, ""); assertPayloadEquals(httpRequest, null, null, false); assertResponseParserClassEquals(method, httpRequest, ParseImageFromJsonResponse.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, null); } }