public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes attributes = ctx.getAttributes(dn); return mapper.mapFromAttributes(attributes); } });
public T executeWithContext(DirContext ctx) throws javax.naming.NamingException { Attributes filteredAttributes = ctx.getAttributes(dn, attributes); return mapper.mapFromAttributes(filteredAttributes); } });
@Test public void testLookup_String_AttributesMapper() throws Exception { expectGetReadOnlyContext(); BasicAttributes expectedAttributes = new BasicAttributes(); when(dirContextMock.getAttributes(DEFAULT_BASE_STRING)).thenReturn(expectedAttributes); Object expected = new Object(); when(attributesMapperMock.mapFromAttributes(expectedAttributes)).thenReturn(expected); Object actual = tested .lookup(DEFAULT_BASE_STRING, attributesMapperMock); verify(dirContextMock).close(); assertThat(actual).isSameAs(expected); }
@Test public void testLookup_AttributesMapper() throws Exception { expectGetReadOnlyContext(); BasicAttributes expectedAttributes = new BasicAttributes(); when(dirContextMock.getAttributes(nameMock)).thenReturn(expectedAttributes); Object expected = new Object(); when(attributesMapperMock.mapFromAttributes(expectedAttributes)).thenReturn(expected); Object actual = tested.lookup(nameMock, attributesMapperMock); verify(dirContextMock).close(); assertThat(actual).isSameAs(expected); }
@Test public void testLookup_String_ReturnAttributes_AttributesMapper() throws Exception { expectGetReadOnlyContext(); String[] attributeNames = new String[] { "cn" }; BasicAttributes expectedAttributes = new BasicAttributes(); expectedAttributes.put("cn", "Some Name"); when(dirContextMock.getAttributes(DEFAULT_BASE_STRING, attributeNames)).thenReturn(expectedAttributes); Object expected = new Object(); when(attributesMapperMock.mapFromAttributes(expectedAttributes)).thenReturn(expected); Object actual = tested.lookup(DEFAULT_BASE_STRING, attributeNames, attributesMapperMock); verify(dirContextMock).close(); assertThat(actual).isSameAs(expected); }
@Test public void testLookup_ReturnAttributes_AttributesMapper() throws Exception { expectGetReadOnlyContext(); String[] attributeNames = new String[] { "cn" }; BasicAttributes expectedAttributes = new BasicAttributes(); expectedAttributes.put("cn", "Some Name"); when(dirContextMock.getAttributes(nameMock, attributeNames)).thenReturn(expectedAttributes); Object expected = new Object(); when(attributesMapperMock.mapFromAttributes(expectedAttributes)).thenReturn(expected); Object actual = tested.lookup(nameMock, attributeNames, attributesMapperMock); verify(dirContextMock).close(); assertThat(actual).isSameAs(expected); }