Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Created shared module and moved shared things into it. Finished stamd…

…ataservice as a deployable
  • Loading branch information...
commit e53774977eb0a3603b1add650aaea71d4f319149 1 parent 98774bd
@mwl mwl authored
View
20 bemyndigelsesservice/pom.xml
@@ -16,24 +16,14 @@
<dependencies>
<dependency>
<groupId>dk.bemyndigelsesregister</groupId>
- <artifactId>shared-test</artifactId>
+ <artifactId>shared</artifactId>
<version>${project.parent.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>3.1.0.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>javax.inject</groupId>
- <artifactId>javax.inject</artifactId>
- <version>1</version>
</dependency>
<dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- <version>2.2</version>
+ <groupId>dk.bemyndigelsesregister</groupId>
+ <artifactId>shared-test</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
View
2  ...service/src/main/java/dk/bemyndigelsesregister/bemyndigelsesservice/config/WebConfig.java
@@ -7,7 +7,7 @@
import javax.inject.Inject;
@Configuration
-@ComponentScan("dk.bemyndigelsesregister.bemyndigelsesservice.web")
+@ComponentScan({"dk.bemyndigelsesregister.bemyndigelsesservice.web", "dk.bemyndigelsesregister.shared.web"})
public class WebConfig extends WebMvcConfigurationSupport {
@Inject
ApplicationRootConfig applicationRootConfig;
View
16 integration-test/pom.xml
@@ -74,6 +74,16 @@
<pingURL>http://localhost:8080/bemyndigelsesservice/health</pingURL>
<pingTimeout>20000</pingTimeout>
</deployable>
+ <deployable>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>stamdataservice</artifactId>
+ <type>war</type>
+ <properties>
+ <context>stamdataservice</context>
+ </properties>
+ <pingURL>http://localhost:8080/stamdataservice/health</pingURL>
+ <pingTimeout>20000</pingTimeout>
+ </deployable>
</deployables>
</deployer>
<configuration>
@@ -95,6 +105,12 @@
</dependency>
<dependency>
<groupId>dk.bemyndigelsesregister</groupId>
+ <artifactId>stamdataservice</artifactId>
+ <version>${project.parent.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>dk.bemyndigelsesregister</groupId>
<artifactId>shared-test</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
View
8 integration-test/src/test/java/penetration/PenetrationITCase.java
@@ -10,8 +10,14 @@
public class PenetrationITCase {
@Test
- public void canAccessHealth() throws Exception {
+ public void canAccessBemyndigelsesserviceHealth() throws Exception {
URLConnection urlConnection = new URL("http://localhost:8080/bemyndigelsesservice/health").openConnection();
assertEquals("OK", IOUtils.toString(urlConnection.getInputStream()));
}
+
+ @Test
+ public void canAccessStamdataserviceHealth() throws Exception {
+ URLConnection urlConnection = new URL("http://localhost:8080/stamdataservice/health").openConnection();
+ assertEquals("OK", IOUtils.toString(urlConnection.getInputStream()));
+ }
}
View
1  pom.xml
@@ -12,6 +12,7 @@
<module>stamdataservice</module>
<module>integration-test</module>
<module>shared-test</module>
+ <module>shared</module>
</modules>
<packaging>pom</packaging>
View
37 shared/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>bemyndigelsesregister</artifactId>
+ <groupId>dk.bemyndigelsesregister</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>shared</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>dk.bemyndigelsesregister</groupId>
+ <artifactId>shared-test</artifactId>
+ <version>${project.parent.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-webmvc</artifactId>
+ <version>3.1.0.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.2</version>
+ </dependency>
+ </dependencies>
+</project>
View
2  ...digelsesservice/web/HealthController.java → ...register/shared/web/HealthController.java
@@ -1,4 +1,4 @@
-package dk.bemyndigelsesregister.bemyndigelsesservice.web;
+package dk.bemyndigelsesregister.shared.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
View
7 stamdataservice/pom.xml
@@ -11,9 +11,16 @@
<artifactId>stamdataservice</artifactId>
+ <packaging>war</packaging>
+
<dependencies>
<dependency>
<groupId>dk.bemyndigelsesregister</groupId>
+ <artifactId>shared</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>dk.bemyndigelsesregister</groupId>
<artifactId>shared-test</artifactId>
<version>${project.parent.version}</version>
<scope>test</scope>
View
7 .../src/main/java/dk/bemyndigelsesregister/stamdataservice/config/ApplicationRootConfig.java
@@ -0,0 +1,7 @@
+package dk.bemyndigelsesregister.stamdataservice.config;
+
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class ApplicationRootConfig {
+}
View
14 stamdataservice/src/main/java/dk/bemyndigelsesregister/stamdataservice/config/WebConfig.java
@@ -0,0 +1,14 @@
+package dk.bemyndigelsesregister.stamdataservice.config;
+
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
+
+import javax.inject.Inject;
+
+@Configuration
+@ComponentScan({"dk.bemyndigelsesregister.stamdataservice.web", "dk.bemyndigelsesregister.shared.web"})
+public class WebConfig extends WebMvcConfigurationSupport {
+ @Inject
+ ApplicationRootConfig applicationRootConfig;
+}
View
38 stamdataservice/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
+ http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+ <display-name>Bemyndigelsesservice</display-name>
+
+ <context-param>
+ <param-name>contextClass</param-name>
+ <param-value>org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>dk.bemyndigelsesregister.stamdataservice.config</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>appServlet</servlet-name>
+ <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+ <init-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value></param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>appServlet</servlet-name>
+ <url-pattern>/</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Please sign in to comment.
Something went wrong with that request. Please try again.