ImmutablePolicyPlaceholder extends AbstractEntityPlaceholder<PolicyId> implements PolicyPlaceholder { @Override public Optional<String> resolve(final CharSequence policyId, final String placeholder) { argumentNotEmpty(placeholder, "placeholder"); checkNotNull(policyId, "Policy ID"); if (policyId instanceof PolicyId) { return doResolve(((PolicyId) policyId), placeholder); } else { return Optional.empty(); } }  @Override String getPrefix(); @Override Optional<String> resolve(final CharSequence policyId, final String placeholder);  }
@Test public void testReplacePolicyId() { assertThat(UNDER_TEST.resolve(POLICY_ID, "id")).contains(POLICY_ID.toString()); }
@Test public void testReplacePolicyName() { assertThat(UNDER_TEST.resolve(POLICY_ID, "name")).contains(NAME); }
@Test public void testReplacePolicyNamespace() { assertThat(UNDER_TEST.resolve(POLICY_ID, "namespace")).contains(NAMESPACE); }
@Test public void testUnknownPlaceholderReturnsEmpty() { assertThat(UNDER_TEST.resolve(POLICY_ID, "policy_id")).isEmpty(); }