Source:
<code>public void testEventTypesForDynamicAddPartitionByInsert() throws IOException { String name = testName.getMethodName(); final String dbName = createDB(name); String replDbName = dbName + "_dupe"; run("CREATE TABLE " + dbName + ".ptned(a string) partitioned by (b int) STORED AS TEXTFILE"); Tuple bootstrap = bootstrapLoadAndVerify(dbName, replDbName); String[] ptn_data = new String[]{ "ten"}; run("INSERT INTO TABLE " + dbName + ".ptned partition(b=1) values('" + ptn_data[0] + "')"); <START> run("DROP TABLE " + dbName + ".ptned"); <END> BehaviourInjection<NotificationEventResponse,NotificationEventResponse> eventTypeValidator = new BehaviourInjection<NotificationEventResponse,NotificationEventResponse>(){ @Nullable @Override public NotificationEventResponse apply(@Nullable NotificationEventResponse eventsList) { if (null != eventsList) { List<NotificationEvent> events = eventsList.getEvents(); for (int i = 0; i < events.size(); i++) { NotificationEvent event = events.get(i); if (event.getDbName().equalsIgnoreCase(dbName)) { if (event.getEventType() == "INSERT") { LOG.error("Encountered INSERT event when it was not expected to"); return null; } } } injectionPathCalled = true; } return eventsList; } }; InjectableBehaviourObjectStore.setGetNextNotificationBehaviour(eventTypeValidator); incrementalLoadAndVerify(dbName, bootstrap.lastReplId, replDbName); eventTypeValidator.assertInjectionsPerformed(true,false); InjectableBehaviourObjectStore.resetGetNextNotificationBehaviour(); verifyIfTableNotExist(replDbName , "ptned"); }</code><technical_language>this is modifying existing test checking for dynamic inserts of partitions, is a separate test for it</technical_language>

Target:
public void testEventTypesForDynamicAddPartitionByInsert() throws IOException { String name = testName.getMethodName(); final String dbName = createDB(name, driver); String replDbName = dbName + "_dupe"; run("CREATE TABLE " + dbName + ".ptned(a string) partitioned by (b int) STORED AS TEXTFILE", driver); Tuple bootstrap = bootstrapLoadAndVerify(dbName, replDbName); String[] ptn_data = new String[]{ "ten"}; run("INSERT INTO TABLE " + dbName + ".ptned partition(b=1) values('" + ptn_data[0] + "')", driver); run("DROP TABLE " + dbName + ".ptned", driver); BehaviourInjection<NotificationEventResponse,NotificationEventResponse> eventTypeValidator = new BehaviourInjection<NotificationEventResponse,NotificationEventResponse>(){ @Nullable @Override public NotificationEventResponse apply(@Nullable NotificationEventResponse eventsList) { if (null != eventsList) { List<NotificationEvent> events = eventsList.getEvents(); for (int i = 0; i < events.size(); i++) { NotificationEvent event = events.get(i); if (event.getDbName().equalsIgnoreCase(dbName)) { if (event.getEventType() == "INSERT") { LOG.error("Encountered INSERT event when it was not expected to"); return null; } } } injectionPathCalled = true; } return eventsList; } }; InjectableBehaviourObjectStore.setGetNextNotificationBehaviour(eventTypeValidator); incrementalLoadAndVerify(dbName, bootstrap.lastReplId, replDbName); eventTypeValidator.assertInjectionsPerformed(true,false); InjectableBehaviourObjectStore.resetGetNextNotificationBehaviour(); verifyIfTableNotExist(replDbName , "ptned", metaStoreClientMirror); }