@Test public void testGetState() { Map<String, Object> state = underTest.getState(); assertThat(state.size(), is(2)); assertThat(state.get("onboarding.required"), is(true)); assertThat(state.get("admin.password.file"), is("path/to/file")); }
@Nullable @Override public Map<String, Object> getState() { needsOnboarding = needsOnboarding && onboardingConfiguration.isEnabled() && onboardingManager.needsOnboarding(); HashMap<String, Object> properties = new HashMap<>(); if (needsOnboarding) { properties.put("onboarding.required", true); } if (adminPasswordFileManager.exists()) { properties.put("admin.password.file", adminPasswordFileManager.getPath()); } return properties.isEmpty() ? null : properties; }
OnboardingStateContributor implements StateContributor { @Nullable @Override public Map<String, Object> getState() { needsOnboarding = needsOnboarding && onboardingConfiguration.isEnabled() && onboardingManager.needsOnboarding(); HashMap<String, Object> properties = new HashMap<>(); if (needsOnboarding) { properties.put("onboarding.required", true); } if (adminPasswordFileManager.exists()) { properties.put("admin.password.file", adminPasswordFileManager.getPath()); } return properties.isEmpty() ? null : properties; } }
OnboardingStateContributor implements StateContributor { @Nullable @Override public Map<String, Object> getState() { needsOnboarding = needsOnboarding && onboardingConfiguration.isEnabled() && onboardingManager.needsOnboarding(); HashMap<String, Object> properties = new HashMap<>(); if (needsOnboarding) { properties.put("onboarding.required", true); } if (adminPasswordFileManager.exists()) { properties.put("admin.password.file", adminPasswordFileManager.getPath()); } return properties.isEmpty() ? null : properties; } @Inject  OnboardingStateContributor(final OnboardingConfiguration onboardingConfiguration,
                                    final OnboardingManager onboardingManager,
                                    final AdminPasswordFileManager adminPasswordFileManager); }
OnboardingStateContributor implements StateContributor { @Nullable @Override public Map<String, Object> getState() { needsOnboarding = needsOnboarding && onboardingConfiguration.isEnabled() && onboardingManager.needsOnboarding(); HashMap<String, Object> properties = new HashMap<>(); if (needsOnboarding) { properties.put("onboarding.required", true); } if (adminPasswordFileManager.exists()) { properties.put("admin.password.file", adminPasswordFileManager.getPath()); } return properties.isEmpty() ? null : properties; } @Inject  OnboardingStateContributor(final OnboardingConfiguration onboardingConfiguration,
                                    final OnboardingManager onboardingManager,
                                    final AdminPasswordFileManager adminPasswordFileManager); @Nullable @Override Map<String, Object> getState(); }
OnboardingStateContributor implements StateContributor { @Nullable @Override public Map<String, Object> getState() { needsOnboarding = needsOnboarding && onboardingConfiguration.isEnabled() && onboardingManager.needsOnboarding(); HashMap<String, Object> properties = new HashMap<>(); if (needsOnboarding) { properties.put("onboarding.required", true); } if (adminPasswordFileManager.exists()) { properties.put("admin.password.file", adminPasswordFileManager.getPath()); } return properties.isEmpty() ? null : properties; } @Inject  OnboardingStateContributor(final OnboardingConfiguration onboardingConfiguration,
                                    final OnboardingManager onboardingManager,
                                    final AdminPasswordFileManager adminPasswordFileManager); @Nullable @Override Map<String, Object> getState();  }