Search in sources :

Example 1 with CredentialView

use of com.sequenceiq.environment.credential.domain.CredentialView in project cloudbreak by hortonworks.

the class CredentialViewConverterTest method testConvertCredential.

@Test
void testConvertCredential() {
    Credential credential = new Credential();
    credential.setName(CRED_NAME);
    credential.setCloudPlatform(CLOUD_PLATFORM);
    credential.setCreator(CREATOR);
    credential.setResourceCrn(CRN);
    credential.setDescription(DESCRIPTION);
    credential.setVerificationStatusText(VERIFICATION_STATUS_TEXT);
    credential.setType(CredentialType.ENVIRONMENT);
    credential.setGovCloud(true);
    CredentialView result = underTest.convert(credential);
    assertEquals(CRED_NAME, result.getName());
    assertEquals(CLOUD_PLATFORM, result.getCloudPlatform());
    assertEquals(CREATOR, result.getCreator());
    assertEquals(CRN, result.getResourceCrn());
    assertEquals(DESCRIPTION, result.getDescription());
    assertEquals(VERIFICATION_STATUS_TEXT, result.getVerificationStatusText());
    assertEquals(CredentialType.ENVIRONMENT, result.getType());
    assertTrue(result.getGovCloud());
}
Also used : Credential(com.sequenceiq.environment.credential.domain.Credential) CredentialView(com.sequenceiq.environment.credential.domain.CredentialView) Test(org.junit.jupiter.api.Test)

Example 2 with CredentialView

use of com.sequenceiq.environment.credential.domain.CredentialView in project cloudbreak by hortonworks.

the class CredentialViewConverterTest method testConvertCredentialView.

@Test
void testConvertCredentialView() {
    CredentialView credentialView = new CredentialView();
    credentialView.setName(CRED_NAME);
    credentialView.setCloudPlatform(CLOUD_PLATFORM);
    credentialView.setCreator(CREATOR);
    credentialView.setResourceCrn(CRN);
    credentialView.setDescription(DESCRIPTION);
    credentialView.setVerificationStatusText(VERIFICATION_STATUS_TEXT);
    credentialView.setType(CredentialType.ENVIRONMENT);
    credentialView.setGovCloud(true);
    CredentialViewResponse result = underTest.convert(credentialView);
    assertEquals(CRED_NAME, result.getName());
    assertEquals(CLOUD_PLATFORM, result.getCloudPlatform());
    assertEquals(CREATOR, result.getCreator());
    assertEquals(CRN, result.getCrn());
    assertEquals(DESCRIPTION, result.getDescription());
    assertEquals(VERIFICATION_STATUS_TEXT, result.getVerificationStatusText());
    assertEquals(CredentialType.ENVIRONMENT, result.getType());
    assertTrue(result.getGovCloud());
}
Also used : CredentialViewResponse(com.sequenceiq.environment.api.v1.credential.model.response.CredentialViewResponse) CredentialView(com.sequenceiq.environment.credential.domain.CredentialView) Test(org.junit.jupiter.api.Test)

Example 3 with CredentialView

use of com.sequenceiq.environment.credential.domain.CredentialView in project cloudbreak by hortonworks.

the class CredentialViewConverter method convert.

public CredentialView convert(Credential credential) {
    CredentialView credentialView = new CredentialView();
    credentialView.setAccountId(credential.getAccountId());
    credentialView.setArchived(credential.isArchived());
    credentialView.setCloudPlatform(credential.getCloudPlatform());
    credentialView.setCreator(credential.getCreator());
    credentialView.setDescription(credential.getDescription());
    credentialView.setGovCloud(credential.getGovCloud());
    credentialView.setName(credential.getName());
    credentialView.setResourceCrn(credential.getResourceCrn());
    credentialView.setVerificationStatusText(credential.getVerificationStatusText());
    credentialView.setType(credential.getType());
    return credentialView;
}
Also used : CredentialView(com.sequenceiq.environment.credential.domain.CredentialView)

Aggregations

CredentialView (com.sequenceiq.environment.credential.domain.CredentialView)3 Test (org.junit.jupiter.api.Test)2 CredentialViewResponse (com.sequenceiq.environment.api.v1.credential.model.response.CredentialViewResponse)1 Credential (com.sequenceiq.environment.credential.domain.Credential)1