+
+ @Test
+ void create_shouldReturnClientExceptionWhenOutputTypeIsInvalid() {
+ // given
+ when(envsForClient.getCaName()).thenReturn(Optional.of(CA_NAME_VALID));
+ when(envsForClient.getOutputPath()).thenReturn(Optional.of(OUTPUT_PATH_VALID));
+ when(envsForClient.getRequestTimeOut()).thenReturn(Optional.of(TIME_OUT_VALID));
+ when(envsForClient.getUrlToCertService()).thenReturn(Optional.of(URL_TO_CERT_SERVICE_VALID));
+ when(envsForClient.getOutputType()).thenReturn(Optional.of(OUTPUT_TYPE_INVALID));
+
+ // when
+ ClientConfigurationFactory configurationFactory = new ClientConfigurationFactory(envsForClient);
+
+ //then
+ assertThatExceptionOfType(ClientConfigurationException.class)
+ .isThrownBy(configurationFactory::create)
+ .withMessageContaining(ClientConfigurationEnvs.OUTPUT_TYPE + " is invalid.");
+ }