|
| 1 | +// Copyright 2018, Oracle Corporation and/or its affiliates. All rights reserved. |
| 2 | +package oracle.kubernetes.operator.create; |
| 3 | + |
| 4 | +import static oracle.kubernetes.operator.create.KubernetesArtifactUtils.*; |
| 5 | +import static org.hamcrest.MatcherAssert.assertThat; |
| 6 | +import static org.hamcrest.Matchers.*; |
| 7 | +import org.junit.AfterClass; |
| 8 | +import org.junit.BeforeClass; |
| 9 | +import org.junit.Test; |
| 10 | + |
| 11 | +/** |
| 12 | + * Tests that the all artifacts in the yaml files that create-domain-operator.sh |
| 13 | + * creates are correct when the admin node port is disabled and t3 channel is disable, |
| 14 | + * and there is no image pull secret. |
| 15 | + */ |
| 16 | +public class CreateDomainGeneratedFilesOptionalFeaturesEnabledTest { |
| 17 | + |
| 18 | + private static CreateDomainInputs inputs; |
| 19 | + private static GeneratedDomainYamlFiles generatedFiles; |
| 20 | + |
| 21 | + private static final String TEST_WEBLOGIC_IMAGE_PULL_SECRET_NAME = "test-weblogic-image-pull-secret-name"; |
| 22 | + |
| 23 | + @BeforeClass |
| 24 | + public static void setup() throws Exception { |
| 25 | + inputs = |
| 26 | + CreateDomainInputs.newInputs() |
| 27 | + .exposeAdminNodePort("true") |
| 28 | + .exposeAdminT3Channel("true") |
| 29 | + .imagePullSecretName(TEST_WEBLOGIC_IMAGE_PULL_SECRET_NAME); |
| 30 | + generatedFiles = GeneratedDomainYamlFiles.generateDomainYamlFiles(inputs); |
| 31 | + } |
| 32 | + |
| 33 | + @AfterClass |
| 34 | + public static void tearDown() throws Exception { |
| 35 | + if (generatedFiles != null) { |
| 36 | + generatedFiles.remove(); |
| 37 | + } |
| 38 | + } |
| 39 | + |
| 40 | + @Test |
| 41 | + public void generatesCorrect_createWeblogicDomainYaml_createWeblogicDomainJob() throws Exception { |
| 42 | +//System.out.println("MOREAUT_DEBUG create domain job =\n" + YamlUtils.newYaml().dump(generatedFiles.getCreateWeblogicDomainJobYaml().getCreateWeblogicDomainJob())); |
| 43 | + // TBD |
| 44 | + } |
| 45 | + |
| 46 | + @Test |
| 47 | + public void generatesCorrect_domainCustomResourceYaml_domain() throws Exception { |
| 48 | +//System.out.println("MOREAUT_DEBUG domain custom resource =\n" + YamlUtils.newYaml().dump(generatedFiles.getDomainCustomResourceYaml().getDomain())); |
| 49 | + // TBD |
| 50 | + } |
| 51 | +} |
0 commit comments