/** Tests populateDomain. */
  @Test
  public void testPopulateDomain() {
    // Expectation
    final SettingDefinitionAdapter settingDefinitionAdapter =
        new SettingDefinitionAdapter() {
          @Override
          Map<String, SettingMetadata> createSettingMetadataMap(
              final List<MetadataDTO> metadataValues) {
            return Collections.emptyMap();
          }
        };

    // Checking
    final SettingDefinition settingDefinition = context.mock(SettingDefinition.class);
    context.checking(
        new Expectations() {
          {
            oneOf(settingDefinition).setPath(NAMESPACE);
            oneOf(settingDefinition).setDescription(DESCRIPTION);
            oneOf(settingDefinition).setMaxOverrideValues(MAXIMUM_OVERRIDES);
            oneOf(settingDefinition).setValueType(DEFAULT_VALUE_TYPE);
            oneOf(settingDefinition).setDefaultValue(DEFAULT_VALUE_VALUE);
            atLeast(1).of(settingDefinition).getMetadata();
            will(returnValue(Collections.emptyMap()));
            oneOf(settingDefinition).setMetadata(Collections.<String, SettingMetadata>emptyMap());
          }
        });

    // Test Data
    SettingDTO settingDTO = new SettingDTO();
    settingDTO.setNameSpace(NAMESPACE);
    settingDTO.setDescription(DESCRIPTION);
    settingDTO.setMaximumOverrides(MAXIMUM_OVERRIDES);
    settingDTO.setDefaultValue(createDefaultValue(DEFAULT_VALUE_TYPE, DEFAULT_VALUE_VALUE));
    settingDTO.setMetadataValues(Collections.<MetadataDTO>emptyList());

    // Result
    settingDefinitionAdapter.populateDomain(settingDTO, settingDefinition);
  }