import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;
import java.io.FileOutputStream;
import org.oran.dmaapadapter.repository.InfoTypes;
import org.oran.dmaapadapter.repository.Jobs;
import org.oran.dmaapadapter.tasks.ProducerRegstrationTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
"app.configuration-filepath=./src/test/resources/test_application_configuration.json"//
})
class ApplicationTest {
- private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
@Autowired
private ApplicationConfig applicationConfig;
@LocalServerPort
int localServerHttpPort;
- private static Gson gson = new GsonBuilder().create();
-
static class TestApplicationConfig extends ApplicationConfig {
@Override
public String getEcsBaseUrl() {
return ErrorResponse.create("", HttpStatus.NOT_FOUND);
} else {
String resp = dmaapResponses.remove(0);
+ logger.info("DMAAP simulator returned: {}", resp);
return new ResponseEntity<>(resp, HttpStatus.OK);
}
ProducerJobInfo request =
new ProducerJobInfo(job.jobDefinition, "ID", job.infoTypeId, job.jobResultUri, job.owner, "TIMESTAMP");
String body = gson.toJson(request);
+ logger.info("ECS Simulator PUT job: {}", body);
restClient.post(url, body).block();
}
import org.oran.dmaapadapter.repository.InfoTypes;
import org.oran.dmaapadapter.repository.Jobs;
import org.oran.dmaapadapter.tasks.ProducerRegstrationTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
"app.ecs-base-url=https://localhost:8434" //
})
class IntegrationWithEcs {
- private static final Logger logger = LoggerFactory.getLogger(ApplicationTest.class);
@Autowired
private ApplicationConfig applicationConfig;