Search in sources :

Example 1 with KObjectImpl

use of org.uberfire.ext.metadata.model.impl.KObjectImpl in project kie-wb-common by kiegroup.

the class FindAllLibraryAssetsQueryTest method cleanupLibraryResults.

@Test
public void cleanupLibraryResults() {
    // This is a temporary way to cleanup index results
    // for library assets list and count.
    // In cluster environment library index each file more than once.
    // The index should be revised on next release (7.6).
    KObject k1 = new KObjectImpl("", "", "clusterId1", "", "key1", new ArrayList<>(), false);
    KObject k2 = new KObjectImpl("", "", "clusterId2", "", "key2", new ArrayList<>(), false);
    List<KObject> kObjects = service.distinct(Arrays.asList(k1, k1, k2));
    assertEquals(2, kObjects.size());
    assertEquals(k1, kObjects.get(0));
    assertEquals(k2, kObjects.get(1));
}
Also used : KObject(org.uberfire.ext.metadata.model.KObject) KObjectImpl(org.uberfire.ext.metadata.model.impl.KObjectImpl) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 KObject (org.uberfire.ext.metadata.model.KObject)1 KObjectImpl (org.uberfire.ext.metadata.model.impl.KObjectImpl)1