// assertThat( cs.getChanges().get( 1 ), is( new ResourceChange(ChangeType.REMOVED, Type.RULE, "A removed rule") ) );
// assertThat( cs.getChanges().get( 2 ), is( new ResourceChange(ChangeType.UPDATED, Type.RULE, "An updated rule") ) );
}
private InternalKieModule createKieJar( String... drls) {
InternalKieModule kieJar = mock( InternalKieModule.class );
KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId("org.kie", "hello-world", "1.0-SNAPSHOT");
List<String> drlFs = new ArrayList<String>();
for( int i=0; i<drls.length; i++ ) {
if( drls[i] != null ) {
String fileName = "src/main/resoureces/org/pkg1/drlFile"+i+".drl";
drlFs.add( fileName );
when( kieJar.getBytes( fileName ) ).thenReturn( drls[i].getBytes() );
}
}
when( kieJar.getBytes( KieModuleModelImpl.KMODULE_JAR_PATH ) ).thenReturn( createKieProjectWithPackages(ks, releaseId).toXML().getBytes() );
when( kieJar.getFileNames() ).thenReturn( drlFs );
return ( InternalKieModule ) kieJar;
}