@Test public void shouldNotAddObjectClassIfPresent() { Entry entry = mock(Entry.class); Attribute attribute = mock(Attribute.class); given(entry.getAttribute(anyString())).willReturn(attribute); TokenAttributeConversion.addObjectClass(entry); verify(entry, times(0)).addAttribute(anyString(), any()); }
public static Entry addObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute == null) { entry.addAttribute(CoreTokenConstants.OBJECT_CLASS, CoreTokenConstants.FR_CORE_TOKEN); } return entry; }
TokenAttributeConversion { public static Entry addObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute == null) { entry.addAttribute(CoreTokenConstants.OBJECT_CLASS, CoreTokenConstants.FR_CORE_TOKEN); } return entry; } }
TokenAttributeConversion { public static Entry addObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute == null) { entry.addAttribute(CoreTokenConstants.OBJECT_CLASS, CoreTokenConstants.FR_CORE_TOKEN); } return entry; } @Inject  TokenAttributeConversion(LDAPConfig constants, LDAPDataConversion conversion); }
TokenAttributeConversion { public static Entry addObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute == null) { entry.addAttribute(CoreTokenConstants.OBJECT_CLASS, CoreTokenConstants.FR_CORE_TOKEN); } return entry; } @Inject  TokenAttributeConversion(LDAPConfig constants, LDAPDataConversion conversion); Entry getEntry(Token token); Map<CoreTokenField, Object> mapFromEntry(Entry entry); Token tokenFromEntry(Entry entry); static Entry addObjectClass(Entry entry); static Entry stripObjectClass(Entry entry); DN generateTokenDN(Token token); DN generateTokenDN(String tokenId); }
TokenAttributeConversion { public static Entry addObjectClass(Entry entry) { Attribute attribute = entry.getAttribute(CoreTokenConstants.OBJECT_CLASS); if (attribute == null) { entry.addAttribute(CoreTokenConstants.OBJECT_CLASS, CoreTokenConstants.FR_CORE_TOKEN); } return entry; } @Inject  TokenAttributeConversion(LDAPConfig constants, LDAPDataConversion conversion); Entry getEntry(Token token); Map<CoreTokenField, Object> mapFromEntry(Entry entry); Token tokenFromEntry(Entry entry); static Entry addObjectClass(Entry entry); static Entry stripObjectClass(Entry entry); DN generateTokenDN(Token token); DN generateTokenDN(String tokenId);  }