Search in sources :

Example 1 with PublicKey

use of com.sequenceiq.mock.spi.controller.PublicKey in project cloudbreak by hortonworks.

the class ResponseModifierServiceTest method testEvaluateResponseWhenResponseMapButTheReturnTypePublicKey.

@Test
public void testEvaluateResponseWhenResponseMapButTheReturnTypePublicKey() throws Throwable {
    MockResponse mockResponse1 = createMockResponse(0, 200, "/path1", "get", null, Map.of("publicKeyId", "id", "publicKey", "hash"), Map.class);
    underTest.addResponse(mockResponse1);
    PublicKey actualPost = underTest.evaluateResponse("get_/path1", PublicKey.class, () -> null);
    assertEquals(actualPost.getPublicKey(), "hash");
    assertEquals(actualPost.getPublicKeyId(), "id");
}
Also used : MockResponse(com.sequenceiq.mock.spi.MockResponse) PublicKey(com.sequenceiq.mock.spi.controller.PublicKey) Test(org.junit.jupiter.api.Test)

Example 2 with PublicKey

use of com.sequenceiq.mock.spi.controller.PublicKey in project cloudbreak by hortonworks.

the class ResponseModifierServiceTest method testEvaluateResponseWhenResponsePublicKeyAndTheReturnTypeAsTheSame.

@Test
public void testEvaluateResponseWhenResponsePublicKeyAndTheReturnTypeAsTheSame() throws Throwable {
    PublicKey publicKey = new PublicKey();
    publicKey.setPublicKey("hash");
    publicKey.setPublicKeyId("id");
    MockResponse mockResponse1 = createMockResponse(0, 200, "/path1", "get", null, publicKey);
    underTest.addResponse(mockResponse1);
    PublicKey actualPost = underTest.evaluateResponse("get_/path1", PublicKey.class, () -> null);
    assertEquals(actualPost.getPublicKey(), "hash");
    assertEquals(actualPost.getPublicKeyId(), "id");
}
Also used : MockResponse(com.sequenceiq.mock.spi.MockResponse) PublicKey(com.sequenceiq.mock.spi.controller.PublicKey) Test(org.junit.jupiter.api.Test)

Aggregations

MockResponse (com.sequenceiq.mock.spi.MockResponse)2 PublicKey (com.sequenceiq.mock.spi.controller.PublicKey)2 Test (org.junit.jupiter.api.Test)2