### Question:
LowerCaseIdCachedServicesDecorator extends IdCachedServicesDecorator { @Override public Map getAttributes(SSOToken token, IdType type, String name, Set attrNames, String amOrgName, String amsdkDN, boolean isString) throws IdRepoException, SSOException { return toLowerCaseKeys(super.getAttributes(token, type, name, attrNames, amOrgName, amsdkDN, isString)); } LowerCaseIdCachedServicesDecorator(IdCachedServices delegate); @Override Map getAttributes(SSOToken token, IdType type, String name, Set attrNames, String amOrgName, String amsdkDN,
                             boolean isString); @Override Map getAttributes(SSOToken token, IdType type, String name, String amOrgName, String amsdkDN);  }### Answer:
@Test public void shouldReturnLowerCaseAttributeNames() throws Exception { Set attrNames = Collections.emptySet(); boolean isString = true; given(mockDelegate.getAttributes(TOKEN, ID_TYPE, NAME, attrNames, AM_ORG_NAME, AM_SDK_DN, isString)) .willReturn(Collections.singletonMap(KEY, VALUE)); Map result = decorator.getAttributes(TOKEN, ID_TYPE, NAME, attrNames, AM_ORG_NAME, AM_SDK_DN, isString); assertEquals(result, Collections.singletonMap(KEY.toLowerCase(), VALUE)); }
@Test public void shouldReturnLowerCaseAttributeNamesWithoutIsString() throws Exception { given(mockDelegate.getAttributes(TOKEN, ID_TYPE, NAME, AM_ORG_NAME, AM_SDK_DN)) .willReturn(Collections.singletonMap(KEY, VALUE)); Map result = decorator.getAttributes(TOKEN, ID_TYPE, NAME, AM_ORG_NAME, AM_SDK_DN); assertEquals(result, Collections.singletonMap(KEY.toLowerCase(), VALUE)); }