@Test
void validateEnvironmentProvidedMissingCassandra() {

    Bundle environmentBundle = new Bundle();
    environmentBundle.getCassandraConnections().put("cassandra1", new CassandraConnection());
    BundleEnvironmentValidator bundleEnvironmentValidator = new BundleEnvironmentValidator(environmentBundle);
    Executable validateBundle = () -> bundleEnvironmentValidator.validateEnvironmentProvided("myBundle", "" +
            "<l7:Bundle xmlns:l7=\"http://ns.l7tech.com/2010/04/gateway-management\">\n" +
            "    <l7:References>" +
            "    </l7:References>\n" +
            "    <l7:Mappings>" +
            "        <l7:Mapping action=\"NewOrExisting\" srcId=\"89dbda0631bd25a08c73c96aebec7f5a\" type=\"CASSANDRA_CONFIGURATION\">\n" +
            "            <l7:Properties>\n" +
            "                <l7:Property key=\"MapBy\">\n" +
            "                    <l7:StringValue>name</l7:StringValue>\n" +
            "                </l7:Property>\n" +
            "                <l7:Property key=\"MapTo\">\n" +
            "                    <l7:StringValue>cassandra</l7:StringValue>\n" +
            "                </l7:Property>\n" +
            "                <l7:Property key=\"FailOnNew\">\n" +
            "                    <l7:BooleanValue>true</l7:BooleanValue>\n" +
            "                </l7:Property>\n" +
            "            </l7:Properties>\n" +
            "        </l7:Mapping>" +
            "    </l7:Mappings>\n" +
            "</l7:Bundle>", APPLICATION);
    MissingEnvironmentException exception = assertThrows(MissingEnvironmentException.class, validateBundle);
    assertTrue(exception.getMessage().contains("cassandra"));
}