/*-
* ========================LICENSE_START=================================
- * ORAN-OSC
+ * O-RAN-SC
* %%
* Copyright (C) 2019 AT&T Intellectual Property and Nokia
* %%
import java.lang.invoke.MethodHandles;
-import org.oransc.ric.e2mgr.client.api.EndcSetupRequestApi;
import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
-import org.oransc.ric.e2mgr.client.api.X2SetupRequestApi;
+import org.oransc.ric.e2mgr.client.api.NodebApi;
import org.oransc.ric.e2mgr.client.invoker.ApiClient;
import org.oransc.ric.e2mgr.client.model.SetupRequest;
import org.slf4j.Logger;
import org.springframework.http.HttpStatus;
/**
- * Creates an implementation of the E2 manager client that answers requests with
- * mock data.
+ * Creates a mock implementation of the E2 manager client API. This version
+ * answers only status codes, no data, so the mock implementations are trivial.
*/
@Profile("mock")
@Configuration
}
@Bean
- public EndcSetupRequestApi endcSetupRequestApi() {
- ApiClient apiClient = apiClient();
- EndcSetupRequestApi mockApi = mock(EndcSetupRequestApi.class);
- when(mockApi.getApiClient()).thenReturn(apiClient);
- return mockApi;
- }
-
- @Bean
- public HealthCheckApi healthCheckApi() {
+ public HealthCheckApi e2HealthCheckApi() {
ApiClient apiClient = apiClient();
HealthCheckApi mockApi = mock(HealthCheckApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
+
doAnswer(i -> {
return null;
- }).when(mockApi).healthCheck();
+ }).when(mockApi).healthGet();
+
return mockApi;
}
@Bean
- public X2SetupRequestApi x2SetupRequestApi() {
+ public NodebApi e2NodebApi() {
ApiClient apiClient = apiClient();
- X2SetupRequestApi mockApi = mock(X2SetupRequestApi.class);
+ NodebApi mockApi = mock(NodebApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
+
+ doAnswer(i -> {
+ return null;
+ }).when(mockApi).endcSetup(any(SetupRequest.class));
+
doAnswer(i -> {
return null;
- }).when(mockApi).setup(any(SetupRequest.class));
+ }).when(mockApi).x2Setup(any(SetupRequest.class));
+
return mockApi;
}