diff options
author | wasala <przemyslaw.wasala@nokia.com> | 2018-07-10 11:47:01 +0200 |
---|---|---|
committer | wasala <przemyslaw.wasala@nokia.com> | 2018-08-07 10:18:47 +0200 |
commit | c1f0313e1f0085afb813d1ba3e2d7fcc71b5833d (patch) | |
tree | 88bece267217d7a1d3d921c85aad2c01778e98f9 /prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiPublisherTaskSpy.java | |
parent | 01578219e470c4cd9b6181c0615759a7118c0abb (diff) |
Checkstyle violations
*Correction of violations
without javadoc
Change-Id: Ida177bf32a58605e74feae5fab22198228e970ce
Issue-ID: DCAEGEN2-563
Signed-off-by: wasala <przemyslaw.wasala@nokia.com>
Diffstat (limited to 'prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiPublisherTaskSpy.java')
-rw-r--r-- | prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiPublisherTaskSpy.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiPublisherTaskSpy.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiPublisherTaskSpy.java new file mode 100644 index 00000000..3a66bd47 --- /dev/null +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiPublisherTaskSpy.java @@ -0,0 +1,51 @@ +/* + * ============LICENSE_START======================================================= + * PROJECT + * ================================================================================ + * Copyright (C) 2018 NOKIA 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.dcaegen2.services.prh.tasks; + +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.spy; + +import org.onap.dcaegen2.services.prh.config.AaiClientConfiguration; +import org.onap.dcaegen2.services.prh.configuration.AppConfig; +import org.onap.dcaegen2.services.prh.service.AaiProducerClient; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; + +/** + * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 4/13/18 + */ +@Configuration +public class AaiPublisherTaskSpy { + + @Bean + @Primary + public AaiProducerTask registerSimpleAaiPublisherTask() { + AppConfig appConfig = spy(AppConfig.class); + doReturn(mock(AaiClientConfiguration.class)).when(appConfig).getAaiClientConfiguration(); + AaiProducerTaskImpl aaiProducerTask = spy(new AaiProducerTaskImpl(appConfig)); + AaiProducerClient aaiProducerClient = mock(AaiProducerClient.class); + doReturn(mock(AaiClientConfiguration.class)).when(aaiProducerTask).resolveConfiguration(); + doReturn(aaiProducerClient).when(aaiProducerTask).resolveClient(); + return aaiProducerTask; + } +} |