diff --git a/pom.xml b/pom.xml
index 35b4d60..ac85a69 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
1.0.0-SNAPSHOT
UI service project
Default tools to build UI BFF
- jar
+ ${packaging.type}
http://www.open-groupe.com
@@ -23,6 +23,7 @@
1.8
true
jazzhub
+ opensaas
2.4.1
3.2.0
@@ -45,64 +46,6 @@
org.springframework.boot
spring-boot-starter-thymeleaf
-
-
- org.springframework.boot
- spring-boot-starter-security
-
-
- org.thymeleaf.extras
- thymeleaf-extras-springsecurity4
-
-
-
- org.springframework
- spring-jdbc
-
-
- org.springframework
- spring-tx
-
-
- org.springframework
- spring-orm
-
-
- org.hibernate
- hibernate-entitymanager
-
-
- org.hsqldb
- hsqldb
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- com.jayway.jsonpath
- json-path
- test
-
-
- com.jayway.jsonpath
- json-path-assert
- test
-
-
- org.webjars
- jasmine
- ${jasmine.version}
- test
-
-
- org.webjars
- jquery-mockjax
- 1.5.3
- test
-
org.springframework.boot
@@ -222,22 +165,6 @@
-
- Compile test resources
- process-test-resources
-
- compile
-
-
- jsx
-
- ${project.basedir}/src/test/resources/static/js
-
-
- ${project.basedir}/src/test/resources/static/js/compiled
-
-
-
@@ -260,64 +187,6 @@
${project.basedir}/src/main/wro/wro.properties
-
-
- com.github.klieber
- phantomjs-maven-plugin
- 0.7
-
-
-
- install
-
-
-
-
- 2.1.1
- false
-
-
-
- com.github.searls
- jasmine-maven-plugin
- 2.1
-
-
-
- test
-
-
-
-
- org.openqa.selenium.phantomjs.PhantomJSDriver
-
-
- phantomjs.binary.path
- ${phantomjs.binary}
-
-
-
- /webjars/jquery.js
- /webjars/react-with-addons.js
- /webjars/react-dom.js
- /webjars/jquery.mockjax.js
- ${project.basedir}/src/test/resources/jasmine/config.js
-
- ${project.build.directory}/classes/static/js
-
- **/*.js
-
-
- **/react-bootstrap.js
- **/app.render.js
-
- ${project.basedir}/src/test/resources/static/js
-
- **/*.spec.js
-
- ${project.basedir}/src/test/resources/jasmine/ReactJsSpecRunner.htmltemplate
-
-
org.apache.maven.plugins
@@ -380,19 +249,6 @@
-
-
- com.github.klieber
- phantomjs-maven-plugin
- [0.7,)
-
- install
-
-
-
-
-
-
@@ -400,4 +256,55 @@
+
+
+
+ webapp
+
+ true
+
+
+ war
+
+
+
+ docker
+
+ jar
+
+
+ app
+
+
+
+ com.spotify
+ docker-maven-plugin
+ 0.2.3
+
+ package
+ ${docker.image.prefix}/${project.artifactId}
+ src/main/docker
+
+
+ /
+ ${project.build.directory}
+ ${project.build.finalName}.jar
+
+
+
+
+
+ build-image
+ package
+
+ build
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
new file mode 100644
index 0000000..d443212
--- /dev/null
+++ b/src/main/docker/Dockerfile
@@ -0,0 +1,34 @@
+FROM alpine:3.2
+
+ENV JRE=jre1.8.0_77 \
+ JAVA_HOME=/opt/jre
+
+# That's an 1.8.0_60 JRE from OpenJDK.net
+# Courtesy to https://github.com/frol/docker-alpine-oraclejdk8 from where the setup of glibc is borrowed
+RUN apk add --update wget curl ca-certificates && \
+ cd /tmp && \
+ wget -q "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" \
+ "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-bin-2.21-r2.apk" && \
+ apk add --allow-untrusted glibc-2.21-r2.apk glibc-bin-2.21-r2.apk && \
+ /usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib && \
+ echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
+ mkdir /opt && \
+ curl -sL -o /tmp/${JRE}.tgz --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" -q "http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jre-8u77-linux-x64.tar.gz" && \
+ cd /opt && tar xzf /tmp/${JRE}.tgz && \
+ ln -s /opt/${JRE} /opt/jre && \
+ ln -s /opt/jre/bin/java /usr/bin/java && \
+ apk del wget curl ca-certificates && \
+ cd /opt/jre/lib/amd64 && rm libjavafx_* libjfx* libfx* && \
+ cd /opt/jre/lib/ && rm -rf ext/jfxrt.jar jfxswt.jar javafx.properties font* && \
+ rm /tmp/* /var/cache/apk/*
+
+VOLUME /tmp
+EXPOSE 8080
+
+ADD app.jar /
+
+RUN sh -c 'touch /app.jar'
+
+CMD ["sh"]
+
+ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
\ No newline at end of file
diff --git a/src/main/java/com/opengroupe/cloud/saas/config/WebMvcConfiguration.java b/src/main/java/com/opengroupe/cloud/saas/config/WebMvcConfiguration.java
deleted file mode 100644
index 152f34d..0000000
--- a/src/main/java/com/opengroupe/cloud/saas/config/WebMvcConfiguration.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.opengroupe.cloud.saas.config;
-
-import org.springframework.context.annotation.Bean;
-import org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect;
-import org.thymeleaf.spring4.SpringTemplateEngine;
-import org.thymeleaf.spring4.view.ThymeleafViewResolver;
-import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
-import org.thymeleaf.templateresolver.TemplateResolver;
-import org.thymeleaf.templateresolver.UrlTemplateResolver;
-
-@org.springframework.context.annotation.Configuration
-public class WebMvcConfiguration {
-
-// @Bean
-// public TemplateResolver templateResolver() {
-// TemplateResolver templateResolver = new ThymeleafViewResolver().;
-// templateResolver.setPrefix("/resources/templates");
-// templateResolver.setSuffix(".html");
-// templateResolver.setTemplateMode("HTML5");
-// templateResolver.setCacheable(false);
-// return templateResolver;
-// }
-
-// @Bean
-// public UrlTemplateResolver urlTemplateResolver() {
-// return new UrlTemplateResolver();
-// }
-
-// @Bean
-// public SpringTemplateEngine templateEngine() {
-// SpringTemplateEngine templateEngine = new SpringTemplateEngine();
-//// templateEngine.addTemplateResolver(templateResolver());
-// templateEngine.addTemplateResolver(urlTemplateResolver());
-// templateEngine.addDialect(new SpringSecurityDialect());
-// return templateEngine;
-// }
-}
diff --git a/src/main/java/com/opengroupe/cloud/saas/config/WebSecurityConfiguration.java b/src/main/java/com/opengroupe/cloud/saas/config/WebSecurityConfiguration.java
deleted file mode 100644
index e879faf..0000000
--- a/src/main/java/com/opengroupe/cloud/saas/config/WebSecurityConfiguration.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.opengroupe.cloud.saas.config;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.HttpMethod;
-import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
-
-@Configuration
-@EnableWebSecurity
-public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.csrf().disable()
- .authorizeRequests()
- .antMatchers(HttpMethod.GET, "/**").anonymous()
- .antMatchers(HttpMethod.POST, "/api/**").anonymous()
- .anyRequest().permitAll();
- }
-}
diff --git a/src/main/resources/templates/fragments/header.html b/src/main/resources/templates/fragments/header.html
index 34ca60a..51aaa1c 100644
--- a/src/main/resources/templates/fragments/header.html
+++ b/src/main/resources/templates/fragments/header.html
@@ -23,12 +23,9 @@
Tasks
diff --git a/src/test/java/com/opengroupe/cloud/saas/rest/CommentControllerTest.java b/src/test/java/com/opengroupe/cloud/saas/rest/CommentControllerTest.java
deleted file mode 100644
index f50868f..0000000
--- a/src/test/java/com/opengroupe/cloud/saas/rest/CommentControllerTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.opengroupe.cloud.saas.rest;
-
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.SpringApplicationConfiguration;
-import org.springframework.http.MediaType;
-import org.springframework.mock.web.MockServletContext;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringApplicationConfiguration(classes = MockServletContext.class)
-@WebAppConfiguration
-public class CommentControllerTest {
-
- private MockMvc mvc;
-
- @Before
- public void setUp() throws Exception {
- mvc = MockMvcBuilders.standaloneSetup(new CommentController()).build();
-
- }
-
- @Test
- public void getHello() throws Exception {
- mvc.perform(MockMvcRequestBuilders.get("/").accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andExpect(content().string(equalTo("Greetings from Spring Boot!")));
- }
-
- @Test
- public void getEmptyComment() throws Exception {
- mvc.perform(MockMvcRequestBuilders.get("/api/comments").accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
- .andExpect(jsonPath("$", hasSize(0)));
- }
-
- @Test
- public void postComment() throws Exception {
- mvc.perform(MockMvcRequestBuilders.post("/api/comments")
- .accept(MediaType.APPLICATION_JSON)
- .param("id", "1")
- .param("author", "Lao Tzu")
- .param("text", "The journey of a thousand miles begins with one step"))
- .andExpect(status().isOk())
- .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
- .andExpect(jsonPath("$", hasSize(1)))
- .andExpect(jsonPath("$[0].id", is(1)))
- .andExpect(jsonPath("$[0].author", is("Lao Tzu")))
- .andExpect(jsonPath("$[0].text", is("The journey of a thousand miles begins with one step")));
- }
-}
diff --git a/src/test/java/com/opengroupe/cloud/saas/web/ViewControllerTest.java b/src/test/java/com/opengroupe/cloud/saas/web/ViewControllerTest.java
deleted file mode 100644
index c481380..0000000
--- a/src/test/java/com/opengroupe/cloud/saas/web/ViewControllerTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package com.opengroupe.cloud.saas.web;
-
-import static org.hamcrest.Matchers.equalTo;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
-
-import javax.annotation.Resource;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.MockitoAnnotations;
-import org.springframework.boot.test.SpringApplicationConfiguration;
-import org.springframework.http.MediaType;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.context.web.WebAppConfiguration;
-import org.springframework.test.web.servlet.MockMvc;
-import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
-import org.springframework.test.web.servlet.setup.MockMvcBuilders;
-import org.springframework.web.context.WebApplicationContext;
-
-import com.opengroupe.cloud.saas.Application;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@SpringApplicationConfiguration(classes = Application.class)
-@WebAppConfiguration
-public class ViewControllerTest {
- private MockMvc mvc;
-
- @Resource
- WebApplicationContext wac;
-
- @Before
- public void setUp() throws Exception {
-
- // Process mock annotations
- MockitoAnnotations.initMocks(this);
-
- mvc = MockMvcBuilders.webAppContextSetup(wac).build();
- }
-
- @Test
- public void getDefaultGreetings() throws Exception {
- mvc.perform(MockMvcRequestBuilders.get("/greeting"))
- .andExpect(status().isOk())
- .andExpect(content().contentType(MediaType.TEXT_HTML_VALUE + ";charset=UTF-8"))
- .andExpect(model().attribute("name", equalTo("World")))
- .andExpect(view().name("greeting"));
- }
-}