Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arsnova/arsnova-backend
  • pcvl72/arsnova-backend
  • tksl38/arsnova-backend
3 results
Show changes
package de.thm.arsnova.websocket.handler;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.test.context.junit4.SpringRunner;
import de.thm.arsnova.websocket.message.CreateFeedback;
@RunWith(SpringRunner.class)
public class FeedbackHandlerTest {
@MockBean
private FeedbackCommandHandler feedbackCommandHandler;
private FeedbackHandler feedbackHandler;
@Before
public void setUp() {
this.feedbackHandler = new FeedbackHandler(feedbackCommandHandler);
}
@Test
public void sendFeedback() throws Exception {
feedbackHandler.send(
"12345678",
new CreateFeedback()
);
final ArgumentCaptor<FeedbackCommandHandler.CreateFeedbackCommand> captor =
ArgumentCaptor.forClass(FeedbackCommandHandler.CreateFeedbackCommand.class);
verify(feedbackCommandHandler, times(1)).handle(captor.capture());
assertThat(captor.getValue().getRoomId()).isEqualTo("12345678");
assertThat(captor.getValue().getPayload()).isInstanceOf(CreateFeedback.class);
}
}
security.arsnova-url=http://localhost:8080
security.cas-server-url=https://cas.thm.de/cas
security.facebook.key=318531508227494
security.facebook.secret=e3f38cfc72bb63e35641b637081a6177
security.twitter.key=PEVtidSG0HzSrxVRPpsCXw
security.twitter.secret=mC0HOvxiEgqwdDWCcDoy3q75nUQPu1bYRp1ncHWGd0
security.google.key=110959746118.apps.googleusercontent.com
security.google.secret=CkzUJZswY8rjWCCYnHVovyGA
security.ssl=false
security.keystore=/etc/arsnova.thm.de.jks
security.storepass=arsnova
couchdb.host=localhost
couchdb.port=5984
couchdb.name=arsnova
# minutes, after which the feedback is deleted
feedback.cleanup=10
socketio.ip=0.0.0.0
socketio.port=10443
\ No newline at end of file
# Configuration overrides for test environment
arsnova:
security:
admin-accounts: "TestAdmin"
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<bean id="sessionService" class="de.thm.arsnova.services.SessionService">
<property name="databaseDao" ref="databaseDao"></property>
</bean>
<bean id="databaseDao" class="de.thm.arsnova.dao.StubDatabaseDao">
</bean>
</beans>
dn: dc=example, dc=com
objectclass: organization
objectclass: top
o: Dummy Organisation
dn: uid=ptsr00, dc=example, dc=com
objectclass: person
objectclass: organizationalperson
objectclass: inetorgperson
uid: ptsr00
sn: Tester
givenName: Patrick
userPassword:: VGVzdA==
dn: uid=ptsr01, dc=example, dc=com
objectclass: person
objectclass: organizationalperson
objectclass: inetorgperson
uid: ptsr01
sn: Tester
givenName: Patricia
userPassword:: VGVzdA==