### Question:
FileDataSecretEnricher extends BaseEnricher { @Override public void create(PlatformMode platformMode, KubernetesListBuilder builder) { addAnnotations(builder); } FileDataSecretEnricher(MavenEnricherContext buildContext); @Override void create(PlatformMode platformMode, KubernetesListBuilder builder);  }### Answer:
@Test public void shouldMaterializeFileContentFromAnnotation() throws IOException { new Expectations() { {{ context.getConfiguration(); result = new Configuration.Builder() .resource(new ResourceConfig()) .build(); }} }; final FileDataSecretEnricher fileDataSecretEnricher = new FileDataSecretEnricher(context); final KubernetesListBuilder builder = new KubernetesListBuilder(); builder.addToSecretItems(createBaseSecret()); fileDataSecretEnricher.create(PlatformMode.kubernetes,builder); final Secret secret = (Secret) builder.buildFirstItem(); final Map<String, String> data = secret.getData(); assertThat(data) .containsKey(TEST_APPLICATION_PROPERTIES); assertThat(data.get(TEST_APPLICATION_PROPERTIES)) .isEqualTo(Base64Util .encodeToString(Files.readAllBytes(Paths.get(TEST_APPLICATION_PROPERTIES_PATH)))); final Map<String, String> annotations = secret.getMetadata().getAnnotations(); assertThat(annotations) .isEmpty(); }
@Test public void shouldMaterializeFileContentFromAnnotation() throws IOException { new Expectations() { {{ context.getConfiguration(); result = new Configuration.Builder() .resource(new ResourceConfig()) .build(); context.resolvePath(TEST_APPLICATION_PROPERTIES_PATH); result = Paths.get(TEST_APPLICATION_PROPERTIES_PATH); }} }; final FileDataSecretEnricher fileDataSecretEnricher = new FileDataSecretEnricher(context); final KubernetesListBuilder builder = new KubernetesListBuilder(); builder.addToSecretItems(createBaseSecret()); fileDataSecretEnricher.create(PlatformMode.kubernetes,builder); final Secret secret = (Secret) builder.buildFirstItem(); final Map<String, String> data = secret.getData(); assertThat(data) .containsKey(TEST_APPLICATION_PROPERTIES); assertThat(data.get(TEST_APPLICATION_PROPERTIES)) .isEqualTo(Base64Util .encodeToString(Files.readAllBytes(Paths.get(TEST_APPLICATION_PROPERTIES_PATH)))); final Map<String, String> annotations = secret.getMetadata().getAnnotations(); assertThat(annotations) .isEmpty(); }