### Question:
LdapTokenAttributeConversion { public DN generateTokenDN(Token token) { return generateTokenDN(token.getTokenId()); } @Inject  LdapTokenAttributeConversion(LDAPDataConversion conversion,
            LdapDataLayerConfiguration dataLayerConfiguration); 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);  }### Answer:
@Test public void shouldProduceDNWithTokenId() { String tokenId = "badger"; LdapDataLayerConfiguration config = mock(LdapDataLayerConfiguration.class); given(config.getTokenStoreRootSuffix()).willReturn(DN.rootDN()); LDAPDataConversion dataConversion = new LDAPDataConversion(); LdapTokenAttributeConversion conversion = new LdapTokenAttributeConversion(dataConversion, config); DN dn = conversion.generateTokenDN(tokenId); verify(config).getTokenStoreRootSuffix(); assertTrue(dn.toString().contains(tokenId)); }
@Test public void shouldAllowPlusSignInDN() { LdapTokenAttributeConversion conversion = generateTokenAttributeConversion(); conversion.generateTokenDN("Badger+"); }