Buggy code:
public class GenericArtifactsByLifecycleTestCase extends GREGIntegrationBaseTest { private String LIFE_CYCLE_NAME = "ServiceLifeCycle" ; private Registry governance ; private GenericArtifactManager genericArtifactManager ; private GenericArtifact genericArtifact ; @ BeforeClass ( alwaysRun = true ) public void initialize ( ) throws Exception { } @ Test ( groups = { "wso2.greg" } , description = "Artifacts<seq2seq4repair_space>by<seq2seq4repair_space>LC" ) public void testAttachLifecycle ( ) throws RegistryException { } @ Test ( groups = { "wso2.greg" } , description = "Artifacts<seq2seq4repair_space>by<seq2seq4repair_space>LC" , dependsOnMethods = "testAttachLifecycle" ) public void testGetArtifactsAfterPromoting ( ) throws RegistryException { GenericArtifact artifact = getAddedGenericArtifact ( ) ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "//_system//governance//trunk//services//com//wso2//www//greg//store//1.0.0-SNAPSHOT//GenericArtifactStoreService" , "2.3.5" ) ; <START_BUG> artifact . invokeAction ( "Promote" , map ) ; <END_BUG> GenericArtifact [ ] filterByLCName = genericArtifactManager . findGenericArtifacts ( new GenericArtifactFilter ( ) { @ Override public boolean matches ( GenericArtifact artifact ) throws GovernanceException { return ( artifact . getQName ( ) . getLocalPart ( ) . equals ( "GenericArtifactStoreService" ) ) && ( LIFE_CYCLE_NAME . equals ( artifact . getLifecycleName ( ) ) ) ; } } ) ; GenericArtifact artifactInBranch ; GenericArtifact artifactInTrunk ; if ( filterByLCName [ 0 ] . getPath ( ) . startsWith ( "//branches//testing//services" ) ) { artifactInBranch = filterByLCName [ 0 ] ; artifactInTrunk = filterByLCName [ 1 ] ; } else { artifactInBranch = filterByLCName [ 1 ] ; artifactInTrunk = filterByLCName [ 0 ] ; } Assert . assertEquals ( filterByLCName . length , 2 , "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>artifacts<seq2seq4repair_space>associated<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>lifecycle<seq2seq4repair_space>found" ) ; Assert . assertEquals ( artifactInTrunk . getPath ( ) , "//trunk//services//com//wso2//www//greg//store//1.0.0-SNAPSHOT//GenericArtifactStoreService" , "Different<seq2seq4repair_space>artifact<seq2seq4repair_space>path<seq2seq4repair_space>found" ) ; Assert . assertEquals ( artifactInBranch . getPath ( ) , "//branches//testing//services//com//wso2//www//greg//store//2.3.5//GenericArtifactStoreService" , "Different<seq2seq4repair_space>artifact<seq2seq4repair_space>path<seq2seq4repair_space>found" ) ; GenericArtifact [ ] filterByLCNameAndStatus = genericArtifactManager . findGenericArtifacts ( new GenericArtifactFilter ( ) { @ Override public boolean matches ( GenericArtifact artifact ) throws GovernanceException { return ( artifact . getQName ( ) . getLocalPart ( ) . equals ( "GenericArtifactStoreService" ) ) && ( "Testing" . equals ( artifact . getLifecycleState ( ) ) ) ; } } ) ; Assert . assertEquals ( filterByLCNameAndStatus . length , 1 , "Wrong<seq2seq4repair_space>number<seq2seq4repair_space>of<seq2seq4repair_space>artifacts<seq2seq4repair_space>associated<seq2seq4repair_space>with<seq2seq4repair_space>the<seq2seq4repair_space>lifecycle<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>given<seq2seq4repair_space>lifecycle<seq2seq4repair_space>state<seq2seq4repair_space>found" ) ; Assert . assertEquals ( filterByLCNameAndStatus [ 0 ] . getPath ( ) , "//branches//testing//services//com//wso2//www//greg//store//2.3.5//GenericArtifactStoreService" , "Different<seq2seq4repair_space>artifact<seq2seq4repair_space>path<seq2seq4repair_space>found" ) ; } private GenericArtifact getAddedGenericArtifact ( ) throws RegistryException { } @ AfterClass ( alwaysRun = true ) public void cleanUp ( ) throws RegistryException { } }

Fix:
artifact . invokeAction ( "Promote" , map , LIFE_CYCLE_NAME ) ;