aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-12 21:06:27 +0300
committerGravatar Vitaly Takmazov2018-04-12 21:06:27 +0300
commitc148012c714cb43d9d7277a54151ab5c2fa7b7d4 (patch)
tree75eaa4ce8f1e4825b070f1758c42921ce1ce2d0c /juick-notifications
parentcf0137083ce96f8d26e7670332c766a6c7d75faf (diff)
notifications: PushServer not yet ready for integration tests
Diffstat (limited to 'juick-notifications')
-rw-r--r--juick-notifications/build.gradle1
-rw-r--r--juick-notifications/src/test/java/com/juick/components/test/NotificationTests.java66
2 files changed, 0 insertions, 67 deletions
diff --git a/juick-notifications/build.gradle b/juick-notifications/build.gradle
index 28290424..a8513dda 100644
--- a/juick-notifications/build.gradle
+++ b/juick-notifications/build.gradle
@@ -6,7 +6,6 @@ dependencies {
compile project(':juick-common')
compile 'com.ganyo:gcm-server:1.1.0'
compile 'com.turo:pushy:0.12.1'
- testCompile("org.springframework.boot:spring-boot-starter-test")
}
compileJava.options.encoding = 'UTF-8'
diff --git a/juick-notifications/src/test/java/com/juick/components/test/NotificationTests.java b/juick-notifications/src/test/java/com/juick/components/test/NotificationTests.java
deleted file mode 100644
index 573771fc..00000000
--- a/juick-notifications/src/test/java/com/juick/components/test/NotificationTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008-2017, Juick
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-package com.juick.components.test;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.spi.LoggingEvent;
-import ch.qos.logback.core.Appender;
-import com.juick.components.Notifications;
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.slf4j.LoggerFactory;
-import org.springframework.web.client.RestTemplate;
-
-import java.util.Collections;
-
-import static org.mockito.ArgumentMatchers.argThat;
-import static org.mockito.Mockito.*;
-
-/**
- * Created by vitalyster on 22.11.2016.
- */
-public class NotificationTests {
-
- @Mock
- RestTemplate rest;
- @Mock
- Notifications push;
-
-
- @Before
- public void init() {
- MockitoAnnotations.initMocks(this);
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void CleanUpTest() {
- when(push.getInvalidAPNSTokens()).thenReturn(Collections.singleton("yoyo"));
- ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
- final Appender mockAppender = mock(Appender.class);
- when(mockAppender.getName()).thenReturn("MOCK");
- root.setLevel(Level.DEBUG);
- root.addAppender(mockAppender);
- push.cleanupTokens();
- verify(mockAppender).doAppend(argThat(argument ->
- ((LoggingEvent)argument).getFormattedMessage().contains("1 tokens")));
- }
-}