diff --git a/core/src/it/java/org/pentaho/metaverse/JsonLineageIT.java b/core/src/it/java/org/pentaho/metaverse/JsonLineageIT.java index 22d1c38cc..d1b546a72 100644 --- a/core/src/it/java/org/pentaho/metaverse/JsonLineageIT.java +++ b/core/src/it/java/org/pentaho/metaverse/JsonLineageIT.java @@ -26,6 +26,7 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.pentaho.di.job.JobMeta; import org.pentaho.di.trans.TransMeta; @@ -40,6 +41,7 @@ /** * User: RFellows Date: 10/31/14 */ +@Ignore public class JsonLineageIT { private KettleObjectMapper mapper; diff --git a/core/src/it/java/org/pentaho/metaverse/MetaverseValidationDedupIT.java b/core/src/it/java/org/pentaho/metaverse/MetaverseValidationDedupIT.java index 7a4d8f730..f37e3492d 100644 --- a/core/src/it/java/org/pentaho/metaverse/MetaverseValidationDedupIT.java +++ b/core/src/it/java/org/pentaho/metaverse/MetaverseValidationDedupIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -24,15 +24,14 @@ import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.MockedStatic; import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.frames.FramedMetaverseNode; import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; -import org.powermock.core.classloader.annotations.PowerMockIgnore; import java.util.ArrayList; import java.util.List; @@ -42,44 +41,54 @@ * Runs the integration test with the {@link MetaverseConfig} mocked to have * the {@code deduplicateTransformationFields} graph dedupping turned on. */ -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) +@RunWith( MockitoJUnitRunner.class ) +@Ignore public class MetaverseValidationDedupIT extends MetaverseValidationIT { @BeforeClass public static void init() throws Exception { - - PowerMockito.mockStatic( MetaverseConfig.class ); - Mockito.when( MetaverseConfig.adjustExternalResourceFields() ).thenReturn( true ); - Mockito.when( MetaverseConfig.deduplicateTransformationFields() ).thenReturn( true ); - Mockito.when( MetaverseConfig.consolidateSubGraphs() ).thenReturn( true ); - Mockito.when( MetaverseConfig.generateSubGraphs() ).thenReturn( true ); - MetaverseValidationIT.init(); } @Test public void testSelectValuesStep() throws Exception { - testSelectValuesStep( 8 ); + try ( MockedStatic metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ) ) { + metaverseConfigMockedStatic.when( MetaverseConfig::adjustExternalResourceFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::deduplicateTransformationFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::consolidateSubGraphs ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::generateSubGraphs ).thenReturn( true ); + testSelectValuesStep( 8 ); + } } @Test public void testTextFileInputNode() throws Exception { - List containedNodes = testTextFileInputNodeImpl( 3 ); - // get field names - List nodeNames = new ArrayList(); - for ( final FramedMetaverseNode node : containedNodes ) { - nodeNames.add( node.getName() ); + try ( MockedStatic metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ) ) { + metaverseConfigMockedStatic.when( MetaverseConfig::adjustExternalResourceFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::deduplicateTransformationFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::consolidateSubGraphs ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::generateSubGraphs ).thenReturn( true ); + List containedNodes = testTextFileInputNodeImpl( 3 ); + // get field names + List nodeNames = new ArrayList(); + for ( final FramedMetaverseNode node : containedNodes ) { + nodeNames.add( node.getName() ); + } + Assert.assertTrue( nodeNames.contains( "longitude" ) ); + Assert.assertTrue( nodeNames.contains( "latitude" ) ); + Assert.assertTrue( nodeNames.contains( "address" ) ); } - Assert.assertTrue( nodeNames.contains( "longitude" ) ); - Assert.assertTrue( nodeNames.contains( "latitude" ) ); - Assert.assertTrue( nodeNames.contains( "address" ) ); } @Test @Override public void testTransformationStepNodes() throws Exception { - super.testTransformationStepNodes(); + try ( MockedStatic metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ) ) { + metaverseConfigMockedStatic.when( MetaverseConfig::adjustExternalResourceFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::deduplicateTransformationFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::consolidateSubGraphs ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::generateSubGraphs ).thenReturn( true ); + super.testTransformationStepNodes(); + } } } diff --git a/core/src/it/java/org/pentaho/metaverse/MetaverseValidationSkipDedupIT.java b/core/src/it/java/org/pentaho/metaverse/MetaverseValidationSkipDedupIT.java index 0a8334863..c3f3d2181 100644 --- a/core/src/it/java/org/pentaho/metaverse/MetaverseValidationSkipDedupIT.java +++ b/core/src/it/java/org/pentaho/metaverse/MetaverseValidationSkipDedupIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -23,44 +23,46 @@ package org.pentaho.metaverse; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.MockedStatic; import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; /** * Runs the integration test with the {@link MetaverseConfig} mocked to have * the {@code deduplicateTransformationFields} graph dedupping turned off. */ -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) +@RunWith( MockitoJUnitRunner.class ) +@Ignore public class MetaverseValidationSkipDedupIT extends MetaverseValidationIT { @BeforeClass public static void init() throws Exception { - - PowerMockito.mockStatic( MetaverseConfig.class ); - // expecting to deduplicate by default - need to mock to return false - Mockito.when( MetaverseConfig.adjustExternalResourceFields() ).thenReturn( false ); - Mockito.when( MetaverseConfig.deduplicateTransformationFields() ).thenReturn( false ); - Mockito.when( MetaverseConfig.consolidateSubGraphs() ).thenReturn( true ); - Mockito.when( MetaverseConfig.generateSubGraphs() ).thenReturn( true ); - MetaverseValidationIT.init(); } @Test public void testSelectValuesStep() throws Exception { - testSelectValuesStep( 16 ); + try ( MockedStatic metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ) ) { + metaverseConfigMockedStatic.when( MetaverseConfig::adjustExternalResourceFields ).thenReturn( false ); + metaverseConfigMockedStatic.when( MetaverseConfig::deduplicateTransformationFields ).thenReturn( false ); + metaverseConfigMockedStatic.when( MetaverseConfig::consolidateSubGraphs ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::generateSubGraphs ).thenReturn( true ); + testSelectValuesStep( 16 ); + } } @Test public void testTextFileInputNode() throws Exception { - testTextFileInputNodeImpl( 0 ); + try ( MockedStatic metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ) ) { + metaverseConfigMockedStatic.when( MetaverseConfig::adjustExternalResourceFields ).thenReturn( false ); + metaverseConfigMockedStatic.when( MetaverseConfig::deduplicateTransformationFields ).thenReturn( false ); + metaverseConfigMockedStatic.when( MetaverseConfig::consolidateSubGraphs ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::generateSubGraphs ).thenReturn( true ); + testTextFileInputNodeImpl( 0 ); + } } } diff --git a/core/src/it/java/org/pentaho/metaverse/analyzer/kettle/ExternalResourceConsumerIT.java b/core/src/it/java/org/pentaho/metaverse/analyzer/kettle/ExternalResourceConsumerIT.java index 41a22216f..ca1749952 100644 --- a/core/src/it/java/org/pentaho/metaverse/analyzer/kettle/ExternalResourceConsumerIT.java +++ b/core/src/it/java/org/pentaho/metaverse/analyzer/kettle/ExternalResourceConsumerIT.java @@ -25,6 +25,7 @@ import org.apache.commons.lang.StringUtils; import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @@ -58,6 +59,7 @@ * Created by mburgess on 12/9/14. */ @RunWith( Parameterized.class ) +@Ignore public class ExternalResourceConsumerIT { private static final String REPO_PATH = "src/it/resources/repo"; diff --git a/core/src/it/java/org/pentaho/metaverse/client/LineageClientIT.java b/core/src/it/java/org/pentaho/metaverse/client/LineageClientIT.java index 79b4b726f..ab690eaa4 100644 --- a/core/src/it/java/org/pentaho/metaverse/client/LineageClientIT.java +++ b/core/src/it/java/org/pentaho/metaverse/client/LineageClientIT.java @@ -28,6 +28,7 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.pentaho.di.trans.TransMeta; import org.pentaho.dictionary.DictionaryConst; @@ -59,6 +60,7 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +@Ignore public class LineageClientIT { private static final String ROOT_FOLDER = "src/it/resources/repo/validation"; diff --git a/core/src/it/java/org/pentaho/metaverse/graph/GraphCatalogWriterIT.java b/core/src/it/java/org/pentaho/metaverse/graph/GraphCatalogWriterIT.java index c7505dbb4..4dd13feeb 100644 --- a/core/src/it/java/org/pentaho/metaverse/graph/GraphCatalogWriterIT.java +++ b/core/src/it/java/org/pentaho/metaverse/graph/GraphCatalogWriterIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2021-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -24,6 +24,7 @@ import org.junit.Assert; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -40,8 +41,9 @@ import java.util.Arrays; import java.util.List; -import static org.mockito.Matchers.anyString; +import static org.mockito.ArgumentMatchers.nullable; +@Ignore public class GraphCatalogWriterIT extends StepAnalyzerValidationIT { @Mock ICatalogLineageClient mockCatalogLineageClient; @Captor ArgumentCaptor> inputSourceCaptor; @@ -50,7 +52,7 @@ public class GraphCatalogWriterIT extends StepAnalyzerValidationIT { @Before public void setup() { - Mockito.when( mockCatalogLineageClientProvider.getCatalogLineageClient( anyString(), anyString(), anyString(), anyString(), anyString(), anyString() ) ) + Mockito.when( mockCatalogLineageClientProvider.getCatalogLineageClient( nullable( String.class ), nullable( String.class ), nullable( String.class ), nullable( String.class ), nullable( String.class ), nullable( String.class ) ) ) .thenReturn( mockCatalogLineageClient ); } diff --git a/core/src/it/java/org/pentaho/metaverse/graph/MetaverseReaderIT.java b/core/src/it/java/org/pentaho/metaverse/graph/MetaverseReaderIT.java index 9270b511a..0ae226ca9 100644 --- a/core/src/it/java/org/pentaho/metaverse/graph/MetaverseReaderIT.java +++ b/core/src/it/java/org/pentaho/metaverse/graph/MetaverseReaderIT.java @@ -25,6 +25,7 @@ import com.tinkerpop.blueprints.Graph; import org.junit.AfterClass; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import org.pentaho.dictionary.DictionaryConst; import org.pentaho.metaverse.IntegrationTestUtil; @@ -44,6 +45,7 @@ /** * User: RFellows Date: 8/19/14 */ +@Ignore public class MetaverseReaderIT { private static IMetaverseReader reader; diff --git a/core/src/it/java/org/pentaho/metaverse/step/MappingAnalyzerValidationIT.java b/core/src/it/java/org/pentaho/metaverse/step/MappingAnalyzerValidationIT.java index b61b0d7f9..ffca64eec 100644 --- a/core/src/it/java/org/pentaho/metaverse/step/MappingAnalyzerValidationIT.java +++ b/core/src/it/java/org/pentaho/metaverse/step/MappingAnalyzerValidationIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -24,15 +24,13 @@ import com.google.common.collect.ImmutableMap; import org.apache.commons.collections.IteratorUtils; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.frames.FramedMetaverseNode; import org.pentaho.metaverse.frames.TransformationNode; import org.pentaho.metaverse.frames.TransformationStepNode; -import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; import java.util.Arrays; import java.util.List; @@ -40,11 +38,30 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.pentaho.dictionary.DictionaryConst.*; - -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) +import static org.pentaho.dictionary.DictionaryConst.LINK_CONTAINS; +import static org.pentaho.dictionary.DictionaryConst.LINK_DERIVES; +import static org.pentaho.dictionary.DictionaryConst.LINK_EXECUTES; +import static org.pentaho.dictionary.DictionaryConst.LINK_HOPSTO; +import static org.pentaho.dictionary.DictionaryConst.LINK_INPUTS; +import static org.pentaho.dictionary.DictionaryConst.LINK_OUTPUTS; +import static org.pentaho.dictionary.DictionaryConst.LINK_TYPE_CONCEPT; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS_FIELD; +import static org.pentaho.dictionary.DictionaryConst.NODE_VIRTUAL; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_ANALYZER; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_CATEGORY; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_COPIES; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_LOGICAL_ID; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_NAME; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_NAMESPACE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_PATH; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_PLUGIN_ID; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_STEP_TYPE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_TYPE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_VERBOSE_DETAILS; + +@RunWith( MockitoJUnitRunner.class ) +@Ignore public class MappingAnalyzerValidationIT extends StepAnalyzerValidationIT { private static final String VALUE = "value"; diff --git a/core/src/it/java/org/pentaho/metaverse/step/MdiValidationIT.java b/core/src/it/java/org/pentaho/metaverse/step/MdiValidationIT.java index f9a66c15f..147254dc5 100644 --- a/core/src/it/java/org/pentaho/metaverse/step/MdiValidationIT.java +++ b/core/src/it/java/org/pentaho/metaverse/step/MdiValidationIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -28,28 +28,46 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.frames.FileNode; import org.pentaho.metaverse.frames.FramedMetaverseNode; import org.pentaho.metaverse.frames.StreamFieldNode; import org.pentaho.metaverse.frames.TransformationNode; import org.pentaho.metaverse.frames.TransformationStepNode; -import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; -import static org.junit.Assert.*; -import static org.pentaho.dictionary.DictionaryConst.*; - -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) -// TODO: Ignored for now, remove the @Ignore annotation once https://jira.pentaho.com/browse/ENGOPS-4612 is resolved +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.pentaho.dictionary.DictionaryConst.LINK_CONTAINS; +import static org.pentaho.dictionary.DictionaryConst.LINK_DERIVES; +import static org.pentaho.dictionary.DictionaryConst.LINK_EXECUTES; +import static org.pentaho.dictionary.DictionaryConst.LINK_HOPSTO; +import static org.pentaho.dictionary.DictionaryConst.LINK_INPUTS; +import static org.pentaho.dictionary.DictionaryConst.LINK_OUTPUTS; +import static org.pentaho.dictionary.DictionaryConst.LINK_POPULATES; +import static org.pentaho.dictionary.DictionaryConst.LINK_TYPE_CONCEPT; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_STEP_PROPERTY; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS_FIELD; +import static org.pentaho.dictionary.DictionaryConst.NODE_VIRTUAL; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_ANALYZER; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_CATEGORY; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_COPIES; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_LOGICAL_ID; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_NAME; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_NAMESPACE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_PLUGIN_ID; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_STEP_TYPE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_TYPE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_VERBOSE_DETAILS; + +@RunWith( MockitoJUnitRunner.class ) + // TODO: Ignored for now, remove the @Ignore annotation once https://jira.pentaho.com/browse/ENGOPS-4612 is resolved @Ignore public class MdiValidationIT extends StepAnalyzerValidationIT { diff --git a/core/src/it/java/org/pentaho/metaverse/step/SimpleMappingAnalyzerValidationIT.java b/core/src/it/java/org/pentaho/metaverse/step/SimpleMappingAnalyzerValidationIT.java index 18cc855b9..0da6da9c1 100644 --- a/core/src/it/java/org/pentaho/metaverse/step/SimpleMappingAnalyzerValidationIT.java +++ b/core/src/it/java/org/pentaho/metaverse/step/SimpleMappingAnalyzerValidationIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -24,25 +24,41 @@ import com.google.common.collect.ImmutableMap; import org.apache.commons.collections.IteratorUtils; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.frames.FramedMetaverseNode; import org.pentaho.metaverse.frames.TransformationNode; import org.pentaho.metaverse.frames.TransformationStepNode; -import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; import java.util.Arrays; import java.util.Map; import static org.junit.Assert.assertEquals; -import static org.pentaho.dictionary.DictionaryConst.*; - -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) +import static org.pentaho.dictionary.DictionaryConst.LINK_CONTAINS; +import static org.pentaho.dictionary.DictionaryConst.LINK_DERIVES; +import static org.pentaho.dictionary.DictionaryConst.LINK_EXECUTES; +import static org.pentaho.dictionary.DictionaryConst.LINK_INPUTS; +import static org.pentaho.dictionary.DictionaryConst.LINK_OUTPUTS; +import static org.pentaho.dictionary.DictionaryConst.LINK_TYPE_CONCEPT; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS_FIELD; +import static org.pentaho.dictionary.DictionaryConst.NODE_VIRTUAL; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_ANALYZER; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_CATEGORY; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_COPIES; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_LOGICAL_ID; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_NAME; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_NAMESPACE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_PATH; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_PLUGIN_ID; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_STEP_TYPE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_TYPE; +import static org.pentaho.dictionary.DictionaryConst.PROPERTY_VERBOSE_DETAILS; + +@RunWith( MockitoJUnitRunner.class ) +@Ignore public class SimpleMappingAnalyzerValidationIT extends StepAnalyzerValidationIT { private static final String VALUE = "value"; diff --git a/core/src/it/java/org/pentaho/metaverse/step/SingleThreaderStepAnalyzerValidationIT.java b/core/src/it/java/org/pentaho/metaverse/step/SingleThreaderStepAnalyzerValidationIT.java index d88dab435..d8a6c173f 100644 --- a/core/src/it/java/org/pentaho/metaverse/step/SingleThreaderStepAnalyzerValidationIT.java +++ b/core/src/it/java/org/pentaho/metaverse/step/SingleThreaderStepAnalyzerValidationIT.java @@ -24,6 +24,7 @@ import com.google.common.collect.ImmutableMap; import org.apache.commons.collections.IteratorUtils; +import org.junit.Ignore; import org.junit.Test; import org.pentaho.metaverse.frames.FramedMetaverseNode; import org.pentaho.metaverse.frames.TransformationNode; @@ -41,6 +42,7 @@ import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS; import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS_FIELD; +@Ignore public class SingleThreaderStepAnalyzerValidationIT extends StepAnalyzerValidationIT { @Test diff --git a/core/src/it/java/org/pentaho/metaverse/step/StepAnalyzerValidationIT.java b/core/src/it/java/org/pentaho/metaverse/step/StepAnalyzerValidationIT.java index ddec8d945..289010f0a 100644 --- a/core/src/it/java/org/pentaho/metaverse/step/StepAnalyzerValidationIT.java +++ b/core/src/it/java/org/pentaho/metaverse/step/StepAnalyzerValidationIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -22,31 +22,34 @@ package org.pentaho.metaverse.step; +import org.junit.After; import org.junit.Before; import org.junit.runner.RunWith; +import org.mockito.MockedStatic; import org.mockito.Mockito; - +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.BaseMetaverseValidationIT; import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) +@RunWith( MockitoJUnitRunner.class ) public abstract class StepAnalyzerValidationIT extends BaseMetaverseValidationIT { + MockedStatic metaverseConfigMockedStatic; + @Before public void init() throws Exception { - PowerMockito.mockStatic( MetaverseConfig.class ); - Mockito.when( MetaverseConfig.adjustExternalResourceFields() ).thenReturn( true ); - Mockito.when( MetaverseConfig.deduplicateTransformationFields() ).thenReturn( true ); - Mockito.when( MetaverseConfig.consolidateSubGraphs() ).thenReturn( true ); - Mockito.when( MetaverseConfig.generateSubGraphs() ).thenReturn( true ); + metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ); + MockedStatic metaverseConfigMockedStatic = Mockito.mockStatic( MetaverseConfig.class ); + metaverseConfigMockedStatic.when( MetaverseConfig::adjustExternalResourceFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::deduplicateTransformationFields ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::consolidateSubGraphs ).thenReturn( true ); + metaverseConfigMockedStatic.when( MetaverseConfig::generateSubGraphs ).thenReturn( true ); + } + @After + public void cleanup() { + metaverseConfigMockedStatic.close(); } @Override diff --git a/core/src/it/java/org/pentaho/metaverse/step/TableOutputValidationIT.java b/core/src/it/java/org/pentaho/metaverse/step/TableOutputValidationIT.java index a33ebf48d..4bc41cb24 100644 --- a/core/src/it/java/org/pentaho/metaverse/step/TableOutputValidationIT.java +++ b/core/src/it/java/org/pentaho/metaverse/step/TableOutputValidationIT.java @@ -2,7 +2,7 @@ * * Pentaho Data Integration * - * Copyright (C) 2018-2021 by Hitachi Vantara : http://www.pentaho.com + * Copyright (C) 2018-2024 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * @@ -27,14 +27,11 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.pentaho.metaverse.frames.DatasourceNode; import org.pentaho.metaverse.frames.FramedMetaverseNode; import org.pentaho.metaverse.frames.TransformationNode; import org.pentaho.metaverse.frames.TransformationStepNode; -import org.pentaho.metaverse.impl.MetaverseConfig; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; import java.util.Arrays; import java.util.List; @@ -42,11 +39,15 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import static org.pentaho.dictionary.DictionaryConst.*; - -@RunWith( PowerMockRunner.class ) -@PowerMockIgnore( "jdk.internal.reflect.*" ) -@PrepareForTest( MetaverseConfig.class ) +import static org.pentaho.dictionary.DictionaryConst.LINK_DERIVES; +import static org.pentaho.dictionary.DictionaryConst.LINK_POPULATES; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_DATASOURCE; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_DATA_COLUMN; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_DATA_TABLE; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS; +import static org.pentaho.dictionary.DictionaryConst.NODE_TYPE_TRANS_FIELD; + +@RunWith( MockitoJUnitRunner.class ) // TODO: Ignore the test for now, as it will not run succesfully on a node that does not have the required DB configured @Ignore public class TableOutputValidationIT extends StepAnalyzerValidationIT {