### Question:
DateLiteralConvertor implements LiteralConvertor<Date> { @Override public String convert(Date target) { Args.checkNotNull(target); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(); builder.append(QUOTE_STRING); builder.append(f.format(target)); builder.append(QUOTE_STRING); return builder.toString(); } DateLiteralConvertor(); @Override /* * (non-Javadoc) * @see jp.co.ctc_g.jfw.core.jdbc.mybatis.LiteralConvertor#convert(java.lang.Object) */ String convert(Date target); @Override /* * (non-Javadoc) * @see jp.co.ctc_g.jfw.core.jdbc.mybatis.LiteralConvertor#getJavaType() */ Class<?> getJavaType();  }### Answer:
@Test public void Dateの値をリテラルに変換する() throws Exception { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); assertThat(target.convert(format.parse("2011-11-01")), is("'2011-11-01'")); }
@Test(expected = InternalException.class) public void 引数がNULLであることを表明() throws Exception { target.convert(null); }