* ONAP : APPC
* ================================================================================
* Copyright (C) 2018 Nokia. All rights reserved.
+ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
* =============================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
assertThat(svcLogicContext.getAttribute(JOB_ID)).isEqualTo("666");
}
+ @SuppressWarnings("unchecked")
public void assertSuccessfulPostCallForStatus(int expectedHttpStatus) throws SvcLogicException {
// GIVEN
Map<String, String> params = givenInputParams(
assertThat(svcLogicContext.getAttribute(RESULT_MESSAGE_ATTR_KEY)).isEqualTo(EXPECTED_RESPONSE_MSG);
}
+ @SuppressWarnings("unchecked")
@Test
public void pushJob_shouldHandleAllOccurringExceptions_duringMethodExecution() {
// GIVEN
assertThat(svcLogicContext.getAttribute(JOB_ID)).isBlank();
}
+ @SuppressWarnings("unchecked")
@Test
public void checkPushJob_shouldSetFailStatusAndMsgInContext_andThrowException_whenRetryTimesParamIsMissing() {
// GIVEN
assertIfInputParamsAreValidated(params);
}
+ @SuppressWarnings("unchecked")
@Test
public void checkPushJob_shouldSetFailStatusAndMsgInContext_andThrowException_whenRetryIntervalParamIsMissing() {
// GIVEN
assertIfInputParamsAreValidated(params);
}
+ @SuppressWarnings("unchecked")
@Test
public void checkPushJob_shouldSetFailStatusAndMsgInContext_andThrowException_whenJobIdParamIsMissing() {
// GIVEN
ChefResponse.create(HttpStatus.SC_OK, "{status:running}"));
}
+ @SuppressWarnings("unchecked")
public void assertCheckJobStatusFor(String expectedHttpStatus, String expectedMessage, ChefResponse firstResponse,
ChefResponse... nextResponses) throws SvcLogicException {
assertThat(svcLogicContext.getAttribute(RESULT_MESSAGE_ATTR_KEY)).isEqualTo(expectedMessage);
}
+ @SuppressWarnings("unchecked")
private Map<String, String> givenInputParams(Entry<String, String>... entries) {
Builder<String, String> paramsBuilder = ImmutableMap.builder();
paramsBuilder.put("username", USERNAME)