SelfFiAccount extends OrmActiveRecord<SelfFiAccount> { public static SelfFiAccount load(final OrmRepository rep, String category, String currency) { return rep.tmpl().load("from SelfFiAccount a where a.category=?1 and a.currency=?2", category, currency); }  static SelfFiAccount load(final OrmRepository rep, String category, String currency);  }
@Test public void 自社金融機関口座を取得する() { tx(() -> { assertThat(SelfFiAccount.load(rep, "sample", "JPY"), allOf( hasProperty("category", is("sample")), hasProperty("currency", is("JPY")), hasProperty("fiCode", is("sample-JPY")), hasProperty("fiAccountId", is("xxxxxx")))); try { SelfFiAccount.load(rep, "sample", "USD"); fail(); } catch (ValidationException e) { assertThat(e.getMessage(), is(ErrorKeys.EntityNotFound)); } }