remove (useless) SenderTest + mockrunner-jms/nekohtml (FINERACT-938)

This commit is contained in:
Michael Vorburger
2020-05-17 10:53:42 +02:00
committed by Michael Vorburger ⛑️
parent f7f52f04d1
commit cbc274f603
5 changed files with 2 additions and 139 deletions
+2 -4
View File
@@ -105,16 +105,14 @@ dependencyManagement {
dependency 'io.swagger:swagger-jersey-jaxrs:1.6.1'
dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
dependency 'jakarta.jms:jakarta.jms-api:2.0.3'
dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
dependency 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
dependency 'org.apache.activemq:activemq-broker:+'
dependency 'org.apache.bval:org.apache.bval.bundle:2.0.3'
dependency 'junit:junit:+'
dependency 'org.mockito:mockito-core:+'
dependency 'com.mockrunner:mockrunner-jms:2.0.4'
dependency 'io.github.classgraph:classgraph:4.8.78'
dependency 'org.dom4j:dom4j:2.1.0'
dependency 'nekohtml:nekohtml:1.9.6.2'
dependency 'org.awaitility:awaitility:4.0.2'
dependency 'org.awaitility:awaitility:4.0.2'
dependencySet(group: 'com.sun.jersey', version: jerseyVersion) {
entry 'jersey-core'
-3
View File
@@ -120,9 +120,6 @@ dependencies {
exclude group: 'commons-logging'
exclude group: 'org.apache.sling'
}
testImplementation ('com.mockrunner:mockrunner-jms') {
exclude group: 'regexp'
}
testImplementation ('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'com.jayway.jsonpath', module: 'json-path'
}
@@ -37,7 +37,6 @@ public class NotificationData implements Serializable {
private List<Long> userIds;
public NotificationData() {
}
public NotificationData(String objectType, Long objectId, String action, Long actorId, String content, boolean isSystemGenerated,
@@ -149,5 +148,4 @@ public class NotificationData implements Serializable {
public void setTenantIdentifier(String tenantIdentifier) {
this.tenantIdentifier = tenantIdentifier;
}
}
@@ -1,78 +0,0 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
package org.apache.fineract.notification;
import com.mockrunner.mock.jms.MockQueue;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import org.apache.fineract.notification.data.NotificationData;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration(locations = {
"classpath:META-INF/testNotificationContext.xml",
})
@RunWith(SpringJUnit4ClassRunner.class)
public class SenderTest {
private final static Logger LOG = LoggerFactory.getLogger(SenderTest.class);
@Autowired
private JmsTemplate jmsTemplate;
@Autowired
private MockQueue mockQueue;
@Test
public void notificationCreation() {
String objectType = "CLIENT";
Long objectIdentifier = 1L;
String action = "created";
Long actorId = 1L;
String notificationContent = "A client was created";
NotificationData notificationData = new NotificationData(
objectType,
objectIdentifier,
action,
actorId,
notificationContent,
false,
false,
null,
null,
null
);
jmsTemplate.send(mockQueue, new MessageCreator() {
@Override
public Message createMessage(Session session) throws JMSException {
LOG.info("Message send successfully");
return session.createObjectMessage(notificationData);
}
});
}
}
@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd">
<bean id="destinationManager" class="com.mockrunner.jms.DestinationManager"/>
<bean id="mockQueue" factory-bean="destinationManager" factory-method="createQueue">
<constructor-arg index="0" value="demoMockRunnerQueue" />
</bean>
<bean id="configurationManager" class="com.mockrunner.jms.ConfigurationManager"/>
<bean id="jmsQueueConnectionFactory" class="com.mockrunner.mock.jms.MockQueueConnectionFactory">
<constructor-arg index="0" ref="destinationManager" />
<constructor-arg index="1" ref="configurationManager" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="jmsQueueConnectionFactory" />
</bean>
<jms:listener-container connection-factory="jmsQueueConnectionFactory" >
<jms:listener destination="demoMockRunnerQueue" ref="testListener" method="onMessage" />
</jms:listener-container>
<bean id="testListener" class="org.apache.fineract.notification.Listener" />
</beans>