コード例 #1
0
  @Test
  public void testSetValue() {
    restValue.setValue(PAYLOAD);

    assertEquals(PAYLOAD, restValue.getValue());
    assertContains(restValue.toString(), "value.length=" + PAYLOAD.length);
  }
コード例 #2
0
  @Test
  public void testSetContentType() {
    restValue.setContentType(PAYLOAD);

    assertEquals(PAYLOAD, restValue.getContentType());
    assertContains(restValue.toString(), "contentType='" + bytesToString(PAYLOAD));
  }
コード例 #3
0
  @Test
  public void testToString_withText() {
    byte[] value = stringToBytes("foobar");
    byte[] contentType = stringToBytes("text");

    restValue = new RestValue(value, contentType);

    assertContains(restValue.toString(), "contentType='text'");
    assertContains(restValue.toString(), "value=\"foobar\"");
  }
コード例 #4
0
 @Test
 public void testToString() {
   assertContains(restValue.toString(), "unknown-content-type");
   assertContains(restValue.toString(), "value.length=0");
 }