PermissionProvider { public String getPermission(String principal){ if("anonymous".equalsIgnoreCase(principal)){ return NOTHING; } return EVERYTHING; }  String getPermission(String principal); final static String NOTHING; final static String EVERYTHING; }
@Test public void anonymous() { String expected = PermissionProvider.NOTHING; String actual = this.cut.getPermission("anonymous"); assertThat(actual,is(expected)); }
@Test public void duke() { String expected = PermissionProvider.EVERYTHING; String actual = this.cut.getPermission("duke"); assertThat(actual,is(expected)); }