Search in sources :

Example 1 with SecretDefinition

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());
}
Also used : Import(com.walmartlabs.concord.imports.Import) Imports(com.walmartlabs.concord.imports.Imports) SecretDefinition(com.walmartlabs.concord.imports.Import.SecretDefinition) Test(org.junit.jupiter.api.Test)

Aggregations

Import (com.walmartlabs.concord.imports.Import)1 SecretDefinition (com.walmartlabs.concord.imports.Import.SecretDefinition)1 Imports (com.walmartlabs.concord.imports.Imports)1 Test (org.junit.jupiter.api.Test)1