Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,13 @@
</exclusion>
</exclusions>
</dependency>
<!-- jhipster-needle-maven-add-dependency -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<!-- jhipster-needle-maven-add-dependency -->
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*
* Copyright 2021 Infosys Ltd.
* Use of this source code is governed by GNU General Public License version 2
* that can be found in the LICENSE file or at
* https://opensource.org/licenses/GPL-2.0
*/

/**
* Autogenerated by Avro
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/*
* Copyright 2021 Infosys Ltd.
* Use of this source code is governed by GNU General Public License version 2
* that can be found in the LICENSE file or at
* https://opensource.org/licenses/GPL-2.0
*/

/**
* Autogenerated by Avro
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.io.IOException;

import org.springframework.boot.autoconfigure.condition.ConditionalOnResource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
Expand All @@ -19,6 +20,7 @@
import com.google.firebase.messaging.FirebaseMessaging;

@Configuration
@ConditionalOnResource(resources = "classpath:forums-firebase.json")
public class FireBaseMessagingConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.stereotype.Service;

import com.google.firebase.messaging.FirebaseMessaging;
Expand All @@ -22,6 +23,7 @@
import com.infy.service.FireBaseMessagingService;

@Service
@ConditionalOnBean(FirebaseMessaging.class)
public class FireBaseMessagingServiceImpl implements FireBaseMessagingService {

private final Logger log = LoggerFactory.getLogger(FireBaseMessagingServiceImpl.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2021 Infosys Ltd.
* Use of this source code is governed by GNU General Public License version 2
* that can be found in the LICENSE file or at
* https://opensource.org/licenses/GPL-2.0
*/

package com.infy.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;

import com.infy.domain.Notification;
import com.infy.service.FireBaseMessagingService;

@Service
@ConditionalOnMissingBean(name = "fireBaseMessagingServiceImpl")
public class FireBaseMessagingServiceNoOpImpl implements FireBaseMessagingService {

private final Logger log = LoggerFactory.getLogger(FireBaseMessagingServiceNoOpImpl.class);

@Override
public String sendNotification(Notification notification, String token) {
log.warn("Firebase not configured (forums-firebase.json missing) — push notification skipped");
return null;
}
}