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");
}
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");
}
Aggregations