Search in sources :

Example 6 with FlowResponsePayload

use of org.openkilda.messaging.payload.flow.FlowResponsePayload in project open-kilda by telstra.

the class FlowControllerTest method updateFlow.

@Test
@WithMockUser(username = USERNAME, password = PASSWORD, roles = ROLE)
public void updateFlow() throws Exception {
    MvcResult mvcResult = mockMvc.perform(put("/v1/flows/{flow-id}", TestMessageMock.FLOW_ID).header(CORRELATION_ID, testCorrelationId()).contentType(APPLICATION_JSON_VALUE).content(MAPPER.writeValueAsString(TestMessageMock.flow))).andReturn();
    MvcResult result = mockMvc.perform(asyncDispatch(mvcResult)).andExpect(status().isOk()).andExpect(content().contentType(APPLICATION_JSON_VALUE)).andReturn();
    FlowResponsePayload response = MAPPER.readValue(result.getResponse().getContentAsString(), FlowResponsePayload.class);
    assertEquals(TestMessageMock.flowResponsePayload, response);
}
Also used : FlowResponsePayload(org.openkilda.messaging.payload.flow.FlowResponsePayload) MvcResult(org.springframework.test.web.servlet.MvcResult) WithMockUser(org.springframework.security.test.context.support.WithMockUser) Test(org.junit.Test)

Example 7 with FlowResponsePayload

use of org.openkilda.messaging.payload.flow.FlowResponsePayload in project open-kilda by telstra.

the class FlowMapper method toFlowResponseOutput.

/**
 * Map {@link FlowDto} into {@link FlowResponsePayload}.
 */
public FlowResponsePayload toFlowResponseOutput(FlowDto f) {
    FlowResponsePayload result = new FlowResponsePayload();
    generatedMap(result, f);
    generatedFlowResponsePayloadMap(result, f);
    mapFlowResponseEndpoints(result, f);
    return result;
}
Also used : FlowResponsePayload(org.openkilda.messaging.payload.flow.FlowResponsePayload)

Aggregations

FlowResponsePayload (org.openkilda.messaging.payload.flow.FlowResponsePayload)7 Test (org.junit.Test)6 WithMockUser (org.springframework.security.test.context.support.WithMockUser)6 MvcResult (org.springframework.test.web.servlet.MvcResult)6 List (java.util.List)1