@Test
 public void getMbcs() throws Exception {
   String result = client.strings().getMbcs();
   String expected =
       "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑ\uE7C7ɡ〇〾⿻⺁\uE843䜣\uE864€";
   Assert.assertEquals(expected, result);
 }
 @Test
 public void putWhitespace() throws Exception {
   client
       .strings()
       .putWhitespace(
           "    Now is the time for all good men to come to the aid of their country    ");
 }
 @Test
 public void getNotProvided() throws Exception {
   try {
     client.strings().getNotProvided();
   } catch (Exception ex) {
     Assert.assertEquals(ServiceException.class, ex.getClass());
     Assert.assertTrue(ex.getMessage().contains("JsonMappingException"));
   }
 }
 @Test
 public void putNull() throws Exception {
   try {
     client.strings().putNull(null);
   } catch (Exception ex) {
     Assert.assertEquals(IllegalArgumentException.class, ex.getClass());
     Assert.assertTrue(ex.getMessage().contains("Body parameter value must not be null"));
   }
 }
  @Test
  public void putEmpty() throws Exception {
    client
        .strings()
        .putEmptyAsync(
            "",
            new ServiceCallback<Void>() {
              @Override
              public void failure(Throwable t) {}

              @Override
              public void success(Void response) {
                lock.countDown();
              }
            });
    Assert.assertTrue(lock.await(1000, TimeUnit.MILLISECONDS));
  }
 @Test
 public void getWhitespace() throws Exception {
   String result = client.strings().getWhitespace();
   Assert.assertEquals(
       "    Now is the time for all good men to come to the aid of their country    ", result);
 }
 @Test
 public void putMbcs() throws Exception {
   String content =
       "啊齄丂狛狜隣郎隣兀﨩ˊ〞〡¦℡㈱‐ー﹡﹢﹫、〓ⅰⅹ⒈€㈠㈩ⅠⅫ! ̄ぁんァヶΑ︴АЯаяāɡㄅㄩ─╋︵﹄︻︱︳︴ⅰⅹɑ\uE7C7ɡ〇〾⿻⺁\uE843䜣\uE864€";
   client.strings().putMbcs(content);
 }
 @Test
 public void getEmpty() throws Exception {
   String result = client.strings().getEmpty();
   Assert.assertEquals("", result);
 }
 @Test
 public void getNull() throws Exception {
   Assert.assertNull(client.strings().getNull());
 }
Exemplo n.º 10
0
 @Test
 public void putBase64UrlEncoded() throws Exception {
   client.strings().putBase64UrlEncoded("a string that gets encoded with base64url".getBytes());
 }
Exemplo n.º 11
0
 @Test
 public void getNullBase64UrlEncoded() throws Exception {
   byte[] result = client.strings().getNullBase64UrlEncoded();
   Assert.assertNull(result);
 }
Exemplo n.º 12
0
 @Test
 public void getBase64UrlEncoded() throws Exception {
   byte[] result = client.strings().getBase64UrlEncoded();
   Assert.assertEquals("a string that gets encoded with base64url", new String(result));
 }