@Test public void emailAuthFailed() throws RuntimeException { GenericAccount genericAccount = null; given(externalRestService.authWithEmailPassword("test1@test.fr", "test1password")).willReturn(genericAccount); Assert.assertNull(paullService.emailAuth("test1@test.fr", "test1password")); }
public GenericAccount emailAuth(String email, String password) { try { return externalRestService.authWithEmailPassword(email, password); } catch (RuntimeException e) { LOGGER.error("[emailAuth] Authentication with generic account {} failed: {}", email, e.getMessage()); return null; } }
PaullService { public GenericAccount emailAuth(String email, String password) { try { return externalRestService.authWithEmailPassword(email, password); } catch (RuntimeException e) { LOGGER.error("[emailAuth] Authentication with generic account {} failed: {}", email, e.getMessage()); return null; } } }
PaullService { public GenericAccount emailAuth(String email, String password) { try { return externalRestService.authWithEmailPassword(email, password); } catch (RuntimeException e) { LOGGER.error("[emailAuth] Authentication with generic account {} failed: {}", email, e.getMessage()); return null; } } PaullService(ExternalRestService externalRestService); }
PaullService { public GenericAccount emailAuth(String email, String password) { try { return externalRestService.authWithEmailPassword(email, password); } catch (RuntimeException e) { LOGGER.error("[emailAuth] Authentication with generic account {} failed: {}", email, e.getMessage()); return null; } } PaullService(ExternalRestService externalRestService); GenericAccount emailAuth(String email, String password); }
PaullService { public GenericAccount emailAuth(String email, String password) { try { return externalRestService.authWithEmailPassword(email, password); } catch (RuntimeException e) { LOGGER.error("[emailAuth] Authentication with generic account {} failed: {}", email, e.getMessage()); return null; } } PaullService(ExternalRestService externalRestService); GenericAccount emailAuth(String email, String password);  }