The 2 statements above are wrong: when running testBasicQuerySessionFromContainer you're using a kieBase that is not the one from which the kieSession has been created. If you replace kieBase with kieSession.getKieBase() both tests become green.