@Test void testFindJdbcService() { CfJdbcService expectedService = Mockito.mock(CfJdbcService.class); Mockito.when(env.findJdbcServiceByName(SERVICE_NAME)) .thenReturn(expectedService); CfJdbcService service = environmentServicesFinder.findJdbcService(SERVICE_NAME); Assertions.assertEquals(expectedService, service); }
public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } }
EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } }
EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder();  EnvironmentServicesFinder(CfJdbcEnv env); }
EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder();  EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findService(String name); }
EnvironmentServicesFinder { public CfJdbcService findJdbcService(String name) { if (StringUtils.isEmpty(name)) { return null; } try { return env.findJdbcServiceByName(name); } catch (IllegalArgumentException e) { return null; } } EnvironmentServicesFinder();  EnvironmentServicesFinder(CfJdbcEnv env); CfJdbcService findJdbcService(String name); CfService findService(String name);  }