| /* |
| ******************************************************************************* |
| * Copyright (c) 2019 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| ******************************************************************************* |
| */ |
| package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.config; |
| |
| import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.StoerungsauskunftInterfaceApplication; |
| import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.api.StoerungsauskunftApi; |
| import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.service.ImportExportService; |
| import org.junit.jupiter.api.Test; |
| import org.springframework.beans.factory.annotation.Autowired; |
| import org.springframework.boot.test.context.SpringBootTest; |
| import org.springframework.boot.test.mock.mockito.MockBean; |
| import org.springframework.boot.test.mock.mockito.SpyBean; |
| import org.springframework.test.context.ActiveProfiles; |
| import org.springframework.test.context.ContextConfiguration; |
| import static org.mockito.Mockito.times; |
| import static org.mockito.Mockito.verify; |
| |
| @SpringBootTest(classes = StoerungsauskunftInterfaceApplication.class) |
| @ContextConfiguration(classes = {TestConfiguration.class}) |
| @ActiveProfiles("test") |
| public class ImportSchedulerConfigTest { |
| |
| @SpyBean |
| private ImportExportService importExportService; |
| |
| @MockBean |
| private StoerungsauskunftApi stoerungsauskunftApi; |
| |
| @Autowired |
| private ImportSchedulerConfig importSchedulerConfig; |
| |
| @Test |
| public void shoulImportUserNotification() { |
| importSchedulerConfig.scheduleTaskImportUserNotifications(); |
| verify(importExportService, times(1)).importUserNotifications(); |
| } |
| } |