@Test public void testConvertNoAttributes() { credential = new Credential("userCrn", "userId", null); CloudCredential cloudCredential = underTest.convert(credential); assertEquals("userCrn", cloudCredential.getId()); assertEquals("userId", cloudCredential.getName()); assertTrue(cloudCredential.getParameters().isEmpty()); }
public CloudCredential convert(Credential credential) { if (credential == null) { return null; } Map<String, Object> fields = isEmpty(credential.getAttributes()) ? new HashMap<>() : new Json(credential.getAttributes()).getMap(); return new CloudCredential(credential.getCrn(), credential.getName(), fields, false); }
CredentialToCloudCredentialConverter implements Converter<Credential, CloudCredential> { public CloudCredential convert(Credential credential) { if (credential == null) { return null; } Map<String, Object> fields = isEmpty(credential.getAttributes()) ? new HashMap<>() : new Json(credential.getAttributes()).getMap(); return new CloudCredential(credential.getCrn(), credential.getName(), fields, false); } }
CredentialToCloudCredentialConverter implements Converter<Credential, CloudCredential> { public CloudCredential convert(Credential credential) { if (credential == null) { return null; } Map<String, Object> fields = isEmpty(credential.getAttributes()) ? new HashMap<>() : new Json(credential.getAttributes()).getMap(); return new CloudCredential(credential.getCrn(), credential.getName(), fields, false); }  }
CredentialToCloudCredentialConverter implements Converter<Credential, CloudCredential> { public CloudCredential convert(Credential credential) { if (credential == null) { return null; } Map<String, Object> fields = isEmpty(credential.getAttributes()) ? new HashMap<>() : new Json(credential.getAttributes()).getMap(); return new CloudCredential(credential.getCrn(), credential.getName(), fields, false); }  CloudCredential convert(Credential credential); }
CredentialToCloudCredentialConverter implements Converter<Credential, CloudCredential> { public CloudCredential convert(Credential credential) { if (credential == null) { return null; } Map<String, Object> fields = isEmpty(credential.getAttributes()) ? new HashMap<>() : new Json(credential.getAttributes()).getMap(); return new CloudCredential(credential.getCrn(), credential.getName(), fields, false); }  CloudCredential convert(Credential credential);  }