@Test
public void testFindTenantAssetTypesAsync() throws ExecutionException, InterruptedException {

    UUID assetId1 = UUIDs.timeBased();
    UUID assetId2 = UUIDs.timeBased();
    UUID tenantId1 = UUIDs.timeBased();
    UUID tenantId2 = UUIDs.timeBased();
    UUID customerId1 = UUIDs.timeBased();
    UUID customerId2 = UUIDs.timeBased();
    saveAsset(UUIDs.timeBased(), tenantId1, customerId1, "TEST_ASSET_1", "TYPE_1");
    saveAsset(UUIDs.timeBased(), tenantId1, customerId1, "TEST_ASSET_2", "TYPE_1");
    saveAsset(UUIDs.timeBased(), tenantId1, customerId1, "TEST_ASSET_3", "TYPE_2");
    saveAsset(UUIDs.timeBased(), tenantId1, customerId1, "TEST_ASSET_4", "TYPE_3");
    saveAsset(UUIDs.timeBased(), tenantId1, customerId1, "TEST_ASSET_5", "TYPE_3");
    saveAsset(UUIDs.timeBased(), tenantId1, customerId1, "TEST_ASSET_6", "TYPE_3");
    saveAsset(UUIDs.timeBased(), tenantId2, customerId2, "TEST_ASSET_7", "TYPE_4");
    saveAsset(UUIDs.timeBased(), tenantId2, customerId2, "TEST_ASSET_8", "TYPE_1");
    saveAsset(UUIDs.timeBased(), tenantId2, customerId2, "TEST_ASSET_9", "TYPE_1");
    List<EntitySubtype> tenant1Types = assetDao.findTenantAssetTypesAsync(tenantId1).get();
    assertNotNull(tenant1Types);
    List<EntitySubtype> tenant2Types = assetDao.findTenantAssetTypesAsync(tenantId2).get();
    assertNotNull(tenant2Types);
    assertEquals(3, tenant1Types.size());
    assertTrue(tenant1Types.stream().anyMatch(t -> t.getType().equals("TYPE_1")));
    assertTrue(tenant1Types.stream().anyMatch(t -> t.getType().equals("TYPE_2")));
    assertTrue(tenant1Types.stream().anyMatch(t -> t.getType().equals("TYPE_3")));
    assertFalse(tenant1Types.stream().anyMatch(t -> t.getType().equals("TYPE_4")));
    assertEquals(2, tenant2Types.size());
    assertTrue(tenant2Types.stream().anyMatch(t -> t.getType().equals("TYPE_1")));
    assertTrue(tenant2Types.stream().anyMatch(t -> t.getType().equals("TYPE_4")));
    assertFalse(tenant2Types.stream().anyMatch(t -> t.getType().equals("TYPE_2")));
    assertFalse(tenant2Types.stream().anyMatch(t -> t.getType().equals("TYPE_3")));
}