X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=datafilecollector%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fdcaegen2%2Fcollectors%2Fdatafile%2Fcontrollers%2FStatusControllerTest.java;fp=datafilecollector%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fdcaegen2%2Fcollectors%2Fdatafile%2Fcontrollers%2FStatusControllerTest.java;h=0000000000000000000000000000000000000000;hb=f0af18429aec79a590835103fedd753ee5ea93a9;hp=8bc63302ae4e24b0d2ff0581c908483323c2b2e5;hpb=54c8fecebbb5e19010e56eddf3aba8e127e0abc3;p=nonrtric%2Fplt%2Franpm.git diff --git a/datafilecollector/src/test/java/org/onap/dcaegen2/collectors/datafile/controllers/StatusControllerTest.java b/datafilecollector/src/test/java/org/onap/dcaegen2/collectors/datafile/controllers/StatusControllerTest.java deleted file mode 100644 index 8bc6330..0000000 --- a/datafilecollector/src/test/java/org/onap/dcaegen2/collectors/datafile/controllers/StatusControllerTest.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * Copyright (C) 2020 Nokia. 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. - * - * SPDX-License-Identifier: Apache-2.0 - * ============LICENSE_END========================================================= - */ - -package org.onap.dcaegen2.collectors.datafile.controllers; - -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.doReturn; - -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.onap.dcaegen2.collectors.datafile.model.Counters; -import org.onap.dcaegen2.collectors.datafile.tasks.CollectAndReportFiles; -import org.springframework.http.HttpHeaders; -import org.springframework.http.ResponseEntity; -import reactor.core.publisher.Mono; - -@ExtendWith(MockitoExtension.class) -public class StatusControllerTest { - @Mock - CollectAndReportFiles scheduledTasksMock; - - StatusController controllerUnderTest; - - @BeforeEach - public void setup() { - controllerUnderTest = new StatusController(scheduledTasksMock); - } - - @Test - public void heartbeat_success() { - HttpHeaders httpHeaders = new HttpHeaders(); - - Mono> result = controllerUnderTest.heartbeat(httpHeaders); - - String body = result.block().getBody(); - assertTrue(body.startsWith("I'm living!")); - } - - @Test - public void status() { - Counters counters = new Counters(); - doReturn(counters).when(scheduledTasksMock).getCounters(); - - HttpHeaders httpHeaders = new HttpHeaders(); - - Mono> result = controllerUnderTest.status(httpHeaders); - - String body = result.block().getBody(); - System.out.println(body); - } - -}