### Question:
KerberosDetailService { public boolean keytabsShouldBeUpdated(String cloudPlatform, boolean childEnvironment, Optional<KerberosConfig> kerberosConfigOptional) { boolean yarnChildEnvironment = CloudPlatform.YARN.name().equals(cloudPlatform) && childEnvironment; boolean supportedOnCloudPlatform = CloudPlatform.AWS.name().equals(cloudPlatform) || CloudPlatform.AZURE.name().equals(cloudPlatform) || CloudPlatform.GCP.name().equals(cloudPlatform) || yarnChildEnvironment; return supportedOnCloudPlatform && kerberosConfigOptional.isPresent() && isIpaJoinable(kerberosConfigOptional.get()); }  String resolveTypeForKerberos(@Nonnull KerberosConfig kerberosConfig); String resolveHostForKerberos(@Nonnull KerberosConfig kerberosConfig, String defaultHost); String resolveHostForKdcAdmin(@Nonnull KerberosConfig kerberosConfig, String defaultHost); String getRealm(@Nonnull String gwDomain, @Nonnull KerberosConfig kerberosConfig); String getDomains(String gwDomain); String resolveLdapUrlForKerberos(@Nonnull KerberosConfig kerberosConfig); String resolveContainerDnForKerberos(@Nonnull KerberosConfig kerberosConfig); boolean areClusterManagerManagedKerberosPackages(@Nonnull KerberosConfig kerberosConfig); boolean isClusterManagerManagedKrb5Config(@Nonnull KerberosConfig kerberosConfig); Map<String, Object> getKerberosEnvProperties(@Nonnull KerberosConfig kerberosConfig); Map<String, Object> getKrb5ConfProperties(@Nonnull KerberosConfig kerberosConfig); boolean isAdJoinable(KerberosConfig kerberosConfig); boolean isIpaJoinable(KerberosConfig kerberosConfig); boolean keytabsShouldBeUpdated(String cloudPlatform, boolean childEnvironment, Optional<KerberosConfig> kerberosConfigOptional); int getDnsTtl();  }### Answer:
@Test public void shouldUpdateKeyTabsInCaseOfYarnChildEnvironment() { KerberosConfig kerberosConfig = mock(KerberosConfig.class); when(kerberosConfig.getType()).thenReturn(KerberosType.FREEIPA); assertTrue(victim.keytabsShouldBeUpdated(CloudPlatform.YARN.name(), true, of(kerberosConfig))); }
@Test public void shouldNotUpdateKeyTabsInCaseOfYarnNonChildEnvironment() { KerberosConfig kerberosConfig = mock(KerberosConfig.class); when(kerberosConfig.getType()).thenReturn(KerberosType.FREEIPA); assertFalse(victim.keytabsShouldBeUpdated(CloudPlatform.YARN.name(), false, of(mock(KerberosConfig.class)))); }