Examples of InventoryFilter


Examples of com.cumulocity.me.sdk.client.inventory.InventoryFilter

        inventory.create(aSampleMo().withType("typeA").withName("A1").build());
        inventory.create(aSampleMo().withType("typeA").withName("A2").build());
        inventory.create(aSampleMo().withType("typeB").withName("B").build());

        // When
        InventoryFilter filterA = new InventoryFilter().byType("typeA");
        ManagedObjectCollectionRepresentation typeAMos = (ManagedObjectCollectionRepresentation) inventory.getManagedObjectsByFilter(filterA).get();

        // Then
        assertThat(typeAMos.getManagedObjects().size()).isEqualTo(2);

        // When
        InventoryFilter filterB = new InventoryFilter().byType("typeB");
        ManagedObjectCollectionRepresentation typeBMos = (ManagedObjectCollectionRepresentation) inventory.getManagedObjectsByFilter(filterB).get();

        // Then
        assertThat(typeBMos.getManagedObjects().size()).isEqualTo(1);
    }
View Full Code Here

Examples of com.cumulocity.me.sdk.client.inventory.InventoryFilter

        // Given
        inventory.create(aSampleMo().withName("MO1").with(new Coordinate()).build());
        inventory.create(aSampleMo().withName("MO2").with(new SecondFragment()).build());

        // When
        InventoryFilter filter = new InventoryFilter().byFragmentType(Coordinate.class);
        ManagedObjectCollectionRepresentation coordinates = (ManagedObjectCollectionRepresentation) inventory.getManagedObjectsByFilter(filter).get();

        // Then
        assertThat(coordinates.getManagedObjects().size()).isEqualTo(1);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.