@Test
public void hivePartitionCreated() {

  when(partition.getDbName()).thenReturn(DATABASE_NAME);
  when(partition.getTableName()).thenReturn(TABLE_NAME);
  when(partition.getSd()).thenReturn(sd);
  when(sd.getLocation()).thenReturn(LOCATION_URI);
  doNothing().when(notificationHandler).send(hivePartitionCreatedCaptor.capture());
  underTest = new HiveNotificationHandler(notificationHandler, HIVE_METASTORE_URIS, DATABASE_NAME);
  underTest.handlePartitionCreated(ROAD_NAME, partition, PARTITION_SPEC, 1L);
  HivePartitionCreated notification = hivePartitionCreatedCaptor.getValue();
  assertThat(notification.getDatabaseName(), is(DATABASE_NAME));
  assertThat(notification.getLocationUri(), is(LOCATION_URI));
  assertThat(notification.getMetastoreUris(), is(HIVE_METASTORE_URIS));
  assertThat(notification.getPartitionSpec(), is(PARTITION_SPEC));
  assertThat(notification.getRecordCount(), is(1L));
  assertThat(notification.getProtocolVersion(), is("1.0"));
  assertThat(notification.getType(), is(RoadNotificationType.HIVE_PARTITION_CREATED));
  assertThat(notification.getRoadName(), is(ROAD_NAME));
  assertThat(notification.getTableName(), is(TABLE_NAME));
}