ZTSClientNotificationSenderImpl implements ZTSClientNotificationSender { public boolean init(NotificationManager notificationManager, RolesProvider rolesProvider, String serverName) { this.isInit = false; this.notificationManager = notificationManager; this.rolesProvider = rolesProvider; this.serverName = serverName; if (this.notificationManager != null && this.rolesProvider != null && !StringUtil.isEmpty(serverName)) { this.isInit = true; } else { LOGGER.warn("ZTSClientNotificationSenderImpl must be initiated with all arguments before it can be used"); } return this.isInit; }  boolean init(NotificationManager notificationManager, RolesProvider rolesProvider, String serverName); @Override void sendNotification(ZTSClientNotification ztsClientNotification);  }
@Test public void testInit() { ZTSClientNotificationSenderImpl ztsClientNotificationSender = new ZTSClientNotificationSenderImpl(); NotificationManager notificationManager = Mockito.mock(NotificationManager.class); RolesProvider rolesProvider = Mockito.mock(RolesProvider.class); String serverName = "testServer"; boolean initResult = ztsClientNotificationSender.init(notificationManager, rolesProvider, serverName); assertTrue(initResult); initResult = ztsClientNotificationSender.init(notificationManager, rolesProvider, null); assertFalse(initResult); initResult = ztsClientNotificationSender.init(notificationManager, null, serverName); assertFalse(initResult); initResult = ztsClientNotificationSender.init(null, rolesProvider, serverName); assertFalse(initResult); }