### Question:
RdsConfigService extends AbstractWorkspaceAwareResourceService<RDSConfig> { public RDSConfig get(Long id) { return rdsConfigRepository.findById(id).orElseThrow(notFound("RDS configuration", id)); }  Set<RDSConfig> findByNamesInWorkspace(Set<String> names, @NotNull Long workspaceId); Set<RDSConfig> retrieveRdsConfigsInWorkspace(Workspace workspace); RDSConfig getByNameForWorkspace(String name, Workspace workspace); RDSConfig get(Long id); RDSConfig getByStackCrnAndType(String stackCrn, DatabaseType databaseType); @Override RDSConfig delete(RDSConfig rdsConfig); RDSConfig createIfNotExists(User user, RDSConfig rdsConfig, Long workspaceId); Set<RDSConfig> findByClusterId(Long clusterId); RDSConfig findByClusterIdAndType(Long clusterId, DatabaseType databaseType); void deleteDefaultRdsConfigs(Set<RDSConfig> rdsConfigs); Set<RDSConfig> findAllByWorkspaceId(Long workspaceId); @Override WorkspaceResourceRepository<RDSConfig, Long> repository(); Set<Cluster> getClustersUsingResource(RDSConfig rdsConfig); RDSConfig resolveVaultValues(RDSConfig config);  }### Answer:
@Test public void testGetRdsConfigById() { when(rdsConfigRepository.findById(eq(1L))).thenReturn(Optional.of(testRdsConfig)); RDSConfig rdsConfig = underTest.get(1L); verify(rdsConfigRepository).findById(eq(1L)); assertEquals(TEST_RDS_CONFIG_NAME, rdsConfig.getName()); }
@Test public void testGetNonExistingRdsConfigById() { when(rdsConfigRepository.findById(anyLong())).thenReturn(Optional.empty()); thrown.expect(NotFoundException.class); underTest.get(1L); }