@Test public void testSelectNo() { given(configuration.get("name")).willReturn("XYZtest"); given(context.get("XYZtest")).willReturn(null); given(configuration.get("no", "UNKNOWN")).willReturn("differentStuffs"); String result = hasEntry.select(3L, context); assertThat(result, is("differentStuffs")); }
public String select (long id, Serializable ser) { Context ctx = (Context) ser; String name = cfg.get ("name"); String action = ctx.get (name) != null ? YES : NO; return cfg.get (action, UNKNOWN); }
HasEntry implements GroupSelector, Configurable { public String select (long id, Serializable ser) { Context ctx = (Context) ser; String name = cfg.get ("name"); String action = ctx.get (name) != null ? YES : NO; return cfg.get (action, UNKNOWN); } }
HasEntry implements GroupSelector, Configurable { public String select (long id, Serializable ser) { Context ctx = (Context) ser; String name = cfg.get ("name"); String action = ctx.get (name) != null ? YES : NO; return cfg.get (action, UNKNOWN); }  }
HasEntry implements GroupSelector, Configurable { public String select (long id, Serializable ser) { Context ctx = (Context) ser; String name = cfg.get ("name"); String action = ctx.get (name) != null ? YES : NO; return cfg.get (action, UNKNOWN); }  int prepare(long id, Serializable o); String select(long id, Serializable ser); void commit(long id, Serializable o); void abort(long id, Serializable o); void setConfiguration(Configuration cfg); }
HasEntry implements GroupSelector, Configurable { public String select (long id, Serializable ser) { Context ctx = (Context) ser; String name = cfg.get ("name"); String action = ctx.get (name) != null ? YES : NO; return cfg.get (action, UNKNOWN); }  int prepare(long id, Serializable o); String select(long id, Serializable ser); void commit(long id, Serializable o); void abort(long id, Serializable o); void setConfiguration(Configuration cfg); static final String YES; static final String NO; static final String UNKNOWN; }