### Question:
ParameterConfigurationConverter { public ParameterConfiguration convert(String parameterName, ParameterValue parameterValue) { ParameterConfiguration parameterConfiguration = new ParameterConfiguration(); parameterConfiguration.setParameterName(parameterName); if (Optional.ofNullable(parameterValue.getExposedParameter()).isPresent()) { parameterConfiguration.setExpose(true); parameterConfiguration.setAlias(parameterValue.getExposedParameter().getName()); return parameterConfiguration; } parameterConfiguration.setExpose(false); parameterConfiguration.setValue(parameterValue.getContent()); return parameterConfiguration; }  ParameterConfiguration convert(String parameterName, ParameterValue parameterValue);  }### Answer:
@Test public void convertHarcodedValue() throws Exception { final String parameterName = "text"; final String value = "admin"; ParameterValue parameterValue = mock(ParameterValue.class); when(parameterValue.getContent()).thenReturn(value); ParameterConfigurationConverter converter = new ParameterConfigurationConverter(); ParameterConfiguration actual = converter.convert(parameterName, parameterValue); assertEquals(parameterName, actual.getParameterName()); assertNull(actual.getAlias()); assertEquals(value, actual.getValue()); assertFalse(actual.isExposed()); }
@Test public void convertExposedValue() { final String parameterName = "text"; final String aliasText = "alias-text"; ParameterValue parameterValue = mock(ParameterValue.class, RETURNS_DEEP_STUBS); when(parameterValue.getExposedParameter().getName()).thenReturn(aliasText); ParameterConfigurationConverter converter = new ParameterConfigurationConverter(); ParameterConfiguration actual = converter.convert(parameterName, parameterValue); assertEquals(parameterName, actual.getParameterName()); assertNull(actual.getValue()); assertEquals(aliasText, actual.getAlias()); assertTrue(actual.isExposed()); }