Skip to content

Commit

Permalink
chore: add fusion-endpoint dependency for endpoint test modules (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
haijian-vaadin authored Dec 8, 2020
1 parent 7c71789 commit 347decc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
7 changes: 7 additions & 0 deletions vaadin-spring-tests/test-ts-services-custom-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>fusion-endpoint</artifactId>
<version>${vaadin.flow.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions vaadin-spring-tests/test-ts-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
<artifactId>flow-polymer-template</artifactId>
<version>${vaadin.flow.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>fusion-endpoint</artifactId>
<version>${vaadin.flow.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
import javax.servlet.ServletContextListener;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Stream;

import com.google.common.collect.Maps;
import org.apache.commons.lang3.StringUtils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -315,8 +314,7 @@ private void initDefaultMocks() {
}

private void mockServletContext() {
final Map<String, Object> servletContextAttributesMap = Maps
.newHashMap();
final Map<String, Object> servletContextAttributesMap = new HashMap<>();
Mockito.doAnswer(answer -> {
String key = answer.getArgument(0, String.class);
Object value = answer.getArgument(1, Object.class);
Expand All @@ -328,12 +326,12 @@ private void mockServletContext() {
.thenAnswer(answer -> servletContextAttributesMap
.get(answer.getArgument(0, String.class)));
Mockito.when(servletContext.getServletRegistrations())
.thenReturn(Maps.newHashMap());
.thenReturn(new HashMap<>());
}

private void mockEnvironment() {
Mockito.when(environment.resolveRequiredPlaceholders(StringUtils.EMPTY))
.thenReturn(StringUtils.EMPTY);
Mockito.when(environment.resolveRequiredPlaceholders(""))
.thenReturn("");
}

private void mockDeploymentConfiguration() {
Expand Down

0 comments on commit 347decc

Please sign in to comment.