Examples of ExternalIDRepresentation


Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

        Map<String, String> params = new HashMap<String, String>();
        params.put("type", extIdType);
        params.put("externaId", extIdValue);

        ExternalIDRepresentation extIdRep = new ExternalIDRepresentation();

        identityApiRep.setExternalId(TEMPLATE_URL);
        when(templateUrlParser.replacePlaceholdersWithParams(TEMPLATE_URL, params)).thenReturn(EXACT_URL);
        when(restConnector.get(EXACT_URL, IdentityMediaType.EXTERNAL_ID, ExternalIDRepresentation.class)).thenReturn(extIdRep);

       
        // When
        ExternalIDRepresentation result = identityApiImpl.getExternalId(extID);

        // Then
        assertThat(result, sameInstance(extIdRep));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

    @Test
    public void testDelete() throws SDKException {
        // Given
        String extIdType = "myExtIdType";
        String extIdValue = "myExtIdValue";
        ExternalIDRepresentation extIdRep = new ExternalIDRepresentation();
        extIdRep.setExternalId(extIdValue);
        extIdRep.setType(extIdType);

        Map<String, String> params = new HashMap<String, String>();
        params.put("type", extIdType);
        params.put("externaId", extIdValue);
View Full Code Here

Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

        // Given
        ManagedObjectRepresentation mo = new ManagedObjectRepresentation();
        String globalIdValue = "myGlobalIdValue";
        mo.setId(new GId(globalIdValue));

        ExternalIDRepresentation repToCreate = new ExternalIDRepresentation();
        repToCreate.setManagedObject(mo);

        ExternalIDRepresentation createdRep = new ExternalIDRepresentation();

        identityApiRep.setExternalIdsOfGlobalId(TEMPLATE_URL);
        when(templateUrlParser.replacePlaceholdersWithParams(TEMPLATE_URL, singletonMap("globalId", globalIdValue))).thenReturn(EXACT_URL);
        when(restConnector.post(EXACT_URL, IdentityMediaType.EXTERNAL_ID, repToCreate)).thenReturn(createdRep);

        // When
        ExternalIDRepresentation result = identityApiImpl.create(repToCreate);

        // Then
        assertThat(result, sameInstance(createdRep));
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

    // Given
    // ------------------------------------------------------------------------

    @Given("I have external id for '(\\d+)' with value '([^']*)' and type '([^']*)'")
    public void iHaveManagedObject(long globalId, String extId, String type) {
        ExternalIDRepresentation rep = new ExternalIDRepresentation();
        rep.setExternalId(extId);
        rep.setType(type);
        ManagedObjectRepresentation mo = new ManagedObjectRepresentation();
        GId gId = new GId();
        gId.setValue(Long.toString(globalId));
        mo.setId(gId);
        rep.setManagedObject(mo);
        input.add(rep);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

        GId gId = new GId();
        gId.setValue(Long.toString(globalId));
        mo.setId(gId);

        for (Row row : rows) {
            ExternalIDRepresentation rep = new ExternalIDRepresentation();
            rep.setExternalId(row.value);
            rep.setType(row.type);
            rep.setManagedObject(mo);
            input.add(rep);
        }
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

        }
    }

    @When("I delete the external id")
    public void iDeleteTheExternalId() throws SDKException {
        ExternalIDRepresentation extIdRep = new ExternalIDRepresentation();
        extIdRep.setExternalId(input.get(0).getExternalId());
        extIdRep.setType(input.get(0).getType());
        identity.deleteExternalId(extIdRep);
    }
View Full Code Here

Examples of com.cumulocity.rest.representation.identity.ExternalIDRepresentation

        for (int index = 0; index < input.size(); index++) {
            result.put(collection1.getExternalIds().get(index).getExternalId(), collection1.getExternalIds().get(index));
        }

        for (int index = 0; index < input.size(); index++) {
            ExternalIDRepresentation rep = result.get(input.get(index).getExternalId());
            assertNotNull(rep);
            assertEquals(input.get(index).getType(), rep.getType());
            assertEquals(input.get(index).getManagedObject().getId().getValue(), rep.getManagedObject().getId().getValue());
        }

    }
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.