use of com.walmartlabs.concord.imports.Import.SecretDefinition in project concord by walmartlabs.
the class MessageSerializerTest method testProcessResponse.
@Test
public void testProcessResponse() {
SecretDefinition secret = SecretDefinition.builder().org("secret-org").name("secret-name").password("secret-password").build();
Import item = Import.GitDefinition.builder().url("http://url").version("master").dest("concord").path("path1").secret(secret).build();
Imports imports = Imports.of(Collections.singletonList(item));
ProcessResponse r = new ProcessResponse(123, "sesion-token", UUID.randomUUID(), "org-name", "repo-url", "repo-path", "commit-id", "repo-branch", "secret-name", imports);
// ---
String rSerialized = MessageSerializer.serialize(r);
assertNotNull(rSerialized);
ProcessResponse rDeserialized = MessageSerializer.deserialize(rSerialized);
assertEquals(r.getMessageType(), MessageType.PROCESS_RESPONSE);
assertEquals(r.getSessionToken(), rDeserialized.getSessionToken());
assertEquals(r.getProcessId(), rDeserialized.getProcessId());
assertEquals(r.getCorrelationId(), rDeserialized.getCorrelationId());
assertEquals("repo-branch", rDeserialized.getRepoBranch());
}
Aggregations