@Test(expected = ResourceNotFoundException.class) public void describeEnvironmentResourceNotFoundException() throws Exception { when(environmentRepository.getEnvironment(isA(EnvironmentId.class))) .thenThrow(new ResourceNotFoundException(ResourceType.ENVIRONMENT, ENVIRONMENT_NAME)); describeEnvironmentApi.describeEnvironment(describeEnvironmentRequest); }
public DescribeEnvironmentResponse describeEnvironment( @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest) throws ResourceNotFoundException, InternalServiceException { final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest = describeEnvironmentRequest.getEnvironmentId(); final EnvironmentId environmentId = apiModelMapper.toModelEnvironmentId(environmentIdFromRequest); try { final Environment environment = environmentRepository.getEnvironment(environmentId); return DescribeEnvironmentResponse.builder() .environment(apiModelMapper.toWrapperEnvironment(environment)) .build(); } catch (final ResourceNotFoundException | InternalServiceException e) { log.error(e.getMessage(), e); throw e; } catch (final Exception e) { log.error(e.getMessage(), e); throw new InternalServiceException(e.getMessage(), e); } }
DescribeEnvironmentApi { public DescribeEnvironmentResponse describeEnvironment( @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest) throws ResourceNotFoundException, InternalServiceException { final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest = describeEnvironmentRequest.getEnvironmentId(); final EnvironmentId environmentId = apiModelMapper.toModelEnvironmentId(environmentIdFromRequest); try { final Environment environment = environmentRepository.getEnvironment(environmentId); return DescribeEnvironmentResponse.builder() .environment(apiModelMapper.toWrapperEnvironment(environment)) .build(); } catch (final ResourceNotFoundException | InternalServiceException e) { log.error(e.getMessage(), e); throw e; } catch (final Exception e) { log.error(e.getMessage(), e); throw new InternalServiceException(e.getMessage(), e); } } }
DescribeEnvironmentApi { public DescribeEnvironmentResponse describeEnvironment( @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest) throws ResourceNotFoundException, InternalServiceException { final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest = describeEnvironmentRequest.getEnvironmentId(); final EnvironmentId environmentId = apiModelMapper.toModelEnvironmentId(environmentIdFromRequest); try { final Environment environment = environmentRepository.getEnvironment(environmentId); return DescribeEnvironmentResponse.builder() .environment(apiModelMapper.toWrapperEnvironment(environment)) .build(); } catch (final ResourceNotFoundException | InternalServiceException e) { log.error(e.getMessage(), e); throw e; } catch (final Exception e) { log.error(e.getMessage(), e); throw new InternalServiceException(e.getMessage(), e); } }  }
DescribeEnvironmentApi { public DescribeEnvironmentResponse describeEnvironment( @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest) throws ResourceNotFoundException, InternalServiceException { final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest = describeEnvironmentRequest.getEnvironmentId(); final EnvironmentId environmentId = apiModelMapper.toModelEnvironmentId(environmentIdFromRequest); try { final Environment environment = environmentRepository.getEnvironment(environmentId); return DescribeEnvironmentResponse.builder() .environment(apiModelMapper.toWrapperEnvironment(environment)) .build(); } catch (final ResourceNotFoundException | InternalServiceException e) { log.error(e.getMessage(), e); throw e; } catch (final Exception e) { log.error(e.getMessage(), e); throw new InternalServiceException(e.getMessage(), e); } }  DescribeEnvironmentResponse describeEnvironment(
      @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest); }
DescribeEnvironmentApi { public DescribeEnvironmentResponse describeEnvironment( @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest) throws ResourceNotFoundException, InternalServiceException { final com.amazonaws.blox.dataservicemodel.v1.model.EnvironmentId environmentIdFromRequest = describeEnvironmentRequest.getEnvironmentId(); final EnvironmentId environmentId = apiModelMapper.toModelEnvironmentId(environmentIdFromRequest); try { final Environment environment = environmentRepository.getEnvironment(environmentId); return DescribeEnvironmentResponse.builder() .environment(apiModelMapper.toWrapperEnvironment(environment)) .build(); } catch (final ResourceNotFoundException | InternalServiceException e) { log.error(e.getMessage(), e); throw e; } catch (final Exception e) { log.error(e.getMessage(), e); throw new InternalServiceException(e.getMessage(), e); } }  DescribeEnvironmentResponse describeEnvironment(
      @NonNull final DescribeEnvironmentRequest describeEnvironmentRequest);  }