automatic project update

This commit is contained in:
Julien Dubois 2017-03-23 17:00:33 +01:00
parent 10ba0fe6e4
commit 1868a99f89
19 changed files with 467 additions and 532 deletions

View File

@ -1,22 +0,0 @@
{
"node": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true,
"white": true,
"predef": ["angular"]
}

View File

@ -1,41 +0,0 @@
os:
- linux
services:
- docker
language: node_js
node_js:
- "6.9.5"
jdk:
- oraclejdk8
sudo: false
cache:
directories:
- node
- node_modules
- $HOME/.m2
- $HOME/.yarn-cache
env:
global:
- NODE_VERSION=6.9.5
- SPRING_OUTPUT_ANSI_ENABLED=ALWAYS
- SPRING_JPA_SHOW_SQL=false
before_install:
- jdk_switcher use oraclejdk8
- java -version
- sudo /etc/init.d/mysql stop
- sudo /etc/init.d/postgresql stop
# Repo for Yarn
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
- yarn global add bower gulp-cli
install:
- yarn install
script:
- ./mvnw clean test
- gulp test
- ./mvnw package -Pprod -DskipTests
notifications:
webhooks:
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false

View File

@ -24,7 +24,7 @@
"en"
],
"serverPort": 8080,
"jhipsterVersion": "4.1.0",
"jhipsterVersion": "4.1.1",
"enableSocialSignIn": false,
"useSass": false,
"jhiPrefix": "jhi",

View File

@ -1,20 +0,0 @@
FROM openjdk:8
ENV JHIPSTER_SLEEP 0
# add source
ADD . /code/
# package the application and delete all lib
RUN echo '{ "allow_root": true }' > /root/.bowerrc && \
cd /code/ && \
./mvnw clean package -Pprod -DskipTests && \
mv /code/target/*.war /app.war && \
rm -Rf /code /root/.npm/ /tmp && \
rm -Rf /root/.m2/
RUN sh -c 'touch /app.war'
VOLUME /tmp
EXPOSE 8080
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." && \
sleep ${JHIPSTER_SLEEP} && \
java -Djava.security.egd=file:/dev/./urandom -jar /app.war

55
Jenkinsfile vendored
View File

@ -1,55 +0,0 @@
#!/usr/bin/env groovy
node {
stage('checkout') {
checkout scm
}
stage('check java') {
sh "java -version"
}
stage('clean') {
sh "./mvnw clean"
}
stage('install tools') {
sh "./mvnw com.github.eirslett:frontend-maven-plugin:install-node-and-yarn -DnodeVersion=v6.9.4 -DyarnVersion=v0.19.1"
}
stage('yarn install') {
sh "./mvnw com.github.eirslett:frontend-maven-plugin:yarn"
}
stage('backend tests') {
try {
sh "./mvnw test"
} catch(err) {
throw err
} finally {
junit '**/target/surefire-reports/TEST-*.xml'
}
}
stage('frontend tests') {
try {
sh "./mvnw com.github.eirslett:frontend-maven-plugin:gulp -Dfrontend.gulp.arguments=test"
} catch(err) {
throw err
} finally {
junit '**/target/test-results/karma/TESTS-*.xml'
}
}
stage('packaging') {
sh "./mvnw package -Pprod -DskipTests"
archiveArtifacts artifacts: '**/target/*.war', fingerprint: true
}
// Uncomment the following block to add Sonar analysis.
/*stage('quality analysis') {
withSonarQubeEnv('Sonar Server') {
sh "./mvnw sonar:sonar"
}
}*/
}

View File

@ -1,5 +1,5 @@
# jhipsterSampleApplication
This application was generated using JHipster 4.1.0, you can find documentation and help at [https://jhipster.github.io/documentation-archive/v4.1.0](https://jhipster.github.io/documentation-archive/v4.1.0).
This application was generated using JHipster 4.1.1, you can find documentation and help at [https://jhipster.github.io/documentation-archive/v4.1.1](https://jhipster.github.io/documentation-archive/v4.1.1).
## Development
@ -96,13 +96,13 @@ For more information refer to [Using Docker and Docker-Compose][], this page als
To configure CI for your project, run the ci-cd sub-generator (`yo jhipster:ci-cd`), this will let you generate configuration files for a number of Continuous Integration systems. Consult the [Setting up Continuous Integration][] page for more information.
[JHipster Homepage and latest documentation]: https://jhipster.github.io
[JHipster 4.1.0 archive]: https://jhipster.github.io/documentation-archive/v4.1.0
[JHipster 4.1.1 archive]: https://jhipster.github.io/documentation-archive/v4.1.1
[Using JHipster in development]: https://jhipster.github.io/documentation-archive/v4.1.0/development/
[Using Docker and Docker-Compose]: https://jhipster.github.io/documentation-archive/v4.1.0/docker-compose
[Using JHipster in production]: https://jhipster.github.io/documentation-archive/v4.1.0/production/
[Running tests page]: https://jhipster.github.io/documentation-archive/v4.1.0/running-tests/
[Setting up Continuous Integration]: https://jhipster.github.io/documentation-archive/v4.1.0/setting-up-ci/
[Using JHipster in development]: https://jhipster.github.io/documentation-archive/v4.1.1/development/
[Using Docker and Docker-Compose]: https://jhipster.github.io/documentation-archive/v4.1.1/docker-compose
[Using JHipster in production]: https://jhipster.github.io/documentation-archive/v4.1.1/production/
[Running tests page]: https://jhipster.github.io/documentation-archive/v4.1.1/running-tests/
[Setting up Continuous Integration]: https://jhipster.github.io/documentation-archive/v4.1.1/setting-up-ci/
[Gatling]: http://gatling.io/
[Node.js]: https://nodejs.org/

View File

@ -1,4 +1,4 @@
// Generated on 2017-03-20 using generator-jhipster 4.1.0
// Generated on 2017-03-23 using generator-jhipster 4.1.1
'use strict';
var gulp = require('gulp'),

View File

@ -14,7 +14,7 @@
"eslint-config-angular": "0.5.0",
"eslint-plugin-angular": "1.3.1",
"event-stream": "3.3.4",
"generator-jhipster": "4.1.0",
"generator-jhipster": "4.1.1",
"gulp": "3.9.1",
"gulp-angular-filesort": "1.1.1",
"gulp-angular-templatecache": "2.0.0",

View File

@ -677,7 +677,7 @@
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</plugins>
</pluginManagement>
</build>
<profiles>

View File

@ -21,15 +21,16 @@ public class LoggingConfiguration {
private LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
@Value("${spring.application.name}")
private String appName;
private final String appName;
@Value("${server.port}")
private String serverPort;
private final String serverPort;
private final JHipsterProperties jHipsterProperties;
public LoggingConfiguration(JHipsterProperties jHipsterProperties) {
public LoggingConfiguration(@Value("${spring.application.name}") String appName, @Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties) {
this.appName = appName;
this.serverPort = serverPort;
this.jHipsterProperties = jHipsterProperties;
if (jHipsterProperties.getLogging().getLogstash().isEnabled()) {
addLogstashAppender(context);

View File

@ -53,7 +53,7 @@ public class User extends AbstractAuditingEntity implements Serializable {
private String lastName;
@Email
@Size(max = 100)
@Size(min = 5, max = 100)
@Column(length = 100, unique = true)
private String email;
@ -220,11 +220,7 @@ public class User extends AbstractAuditingEntity implements Serializable {
User user = (User) o;
if (!login.equals(user.login)) {
return false;
}
return true;
return login.equals(user.login);
}
@Override

View File

@ -13,7 +13,6 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.net.URISyntaxException;
import java.time.LocalDate;
import java.util.List;

View File

@ -4,8 +4,6 @@ import org.springframework.data.domain.Page;
import org.springframework.http.HttpHeaders;
import org.springframework.web.util.UriComponentsBuilder;
import java.net.URISyntaxException;
/**
* Utility class for handling pagination.
*

View File

@ -27,7 +27,7 @@ public class ManagedUserVM extends UserDTO {
String createdBy, ZonedDateTime createdDate, String lastModifiedBy, ZonedDateTime lastModifiedDate,
Set<String> authorities) {
super(id, login, firstName, lastName, email, activated, imageUrl, langKey,
super(id, login, firstName, lastName, email, activated, imageUrl, langKey,
createdBy, createdDate, lastModifiedBy, lastModifiedDate, authorities);
this.password = password;

View File

@ -2,7 +2,7 @@
"activate": {
"title": "Activation",
"messages": {
"success": "<strong>Your user has been activated.</strong> Please <a class=\"alert-link\" href=\"\" ng-click=\"vm.login()\">sign in</a>.",
"success": "<strong>Your user account has been activated.</strong> Please <a class=\"alert-link\" href=\"\" ng-click=\"vm.login()\">sign in</a>.",
"error": "<strong>Your user could not be activated.</strong> Please use the registration form to sign up."
}
}

View File

@ -113,6 +113,7 @@ public class AccountResourceIntTest {
user.setLastName("doe");
user.setEmail("john.doe@jhipster.com");
user.setImageUrl("http://placehold.it/50x50");
user.setLangKey("en");
user.setAuthorities(authorities);
when(mockUserService.getUserWithAuthorities()).thenReturn(user);
@ -125,6 +126,7 @@ public class AccountResourceIntTest {
.andExpect(jsonPath("$.lastName").value("doe"))
.andExpect(jsonPath("$.email").value("john.doe@jhipster.com"))
.andExpect(jsonPath("$.imageUrl").value("http://placehold.it/50x50"))
.andExpect(jsonPath("$.langKey").value("en"))
.andExpect(jsonPath("$.authorities").value(AuthoritiesConstants.ADMIN));
}
@ -273,8 +275,8 @@ public class AccountResourceIntTest {
null, // lastModifiedDate
new HashSet<>(Arrays.asList(AuthoritiesConstants.USER)));
// Duplicate login, different e-mail
ManagedUserVM duplicatedUser = new ManagedUserVM(validUser.getId(), validUser.getLogin(), validUser.getPassword(), validUser.getLogin(), validUser.getLastName(),
// Duplicate login, different email
ManagedUserVM duplicatedUser = new ManagedUserVM(validUser.getId(), validUser.getLogin(), validUser.getPassword(), validUser.getFirstName(), validUser.getLastName(),
"alicejr@example.com", true, validUser.getImageUrl(), validUser.getLangKey(), validUser.getCreatedBy(), validUser.getCreatedDate(), validUser.getLastModifiedBy(), validUser.getLastModifiedDate(), validUser.getAuthorities());
// Good user

View File

@ -7,7 +7,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;

View File

@ -128,8 +128,8 @@ public class UserResourceIntTest {
int databaseSizeBeforeCreate = userRepository.findAll().size();
// Create the User
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
null,
DEFAULT_LOGIN,
@ -144,7 +144,7 @@ public class UserResourceIntTest {
null,
null,
null,
autorities);
authorities);
restUserMockMvc.perform(post("/api/users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
@ -168,8 +168,8 @@ public class UserResourceIntTest {
public void createUserWithExistingId() throws Exception {
int databaseSizeBeforeCreate = userRepository.findAll().size();
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
1L,
DEFAULT_LOGIN,
@ -184,7 +184,7 @@ public class UserResourceIntTest {
null,
null,
null,
autorities);
authorities);
// An entity with an existing ID cannot be created, so this API call must fail
restUserMockMvc.perform(post("/api/users")
@ -204,8 +204,8 @@ public class UserResourceIntTest {
userRepository.saveAndFlush(user);
int databaseSizeBeforeCreate = userRepository.findAll().size();
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
null,
DEFAULT_LOGIN, // this login should already be used
@ -220,7 +220,7 @@ public class UserResourceIntTest {
null,
null,
null,
autorities);
authorities);
// Create the User
restUserMockMvc.perform(post("/api/users")
@ -240,8 +240,8 @@ public class UserResourceIntTest {
userRepository.saveAndFlush(user);
int databaseSizeBeforeCreate = userRepository.findAll().size();
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
null,
"anotherlogin",
@ -256,7 +256,7 @@ public class UserResourceIntTest {
null,
null,
null,
autorities);
authorities);
// Create the User
restUserMockMvc.perform(post("/api/users")
@ -323,8 +323,8 @@ public class UserResourceIntTest {
// Update the user
User updatedUser = userRepository.findOne(user.getId());
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
updatedUser.getId(),
updatedUser.getLogin(),
@ -339,7 +339,7 @@ public class UserResourceIntTest {
updatedUser.getCreatedDate(),
updatedUser.getLastModifiedBy(),
updatedUser.getLastModifiedDate(),
autorities);
authorities);
restUserMockMvc.perform(put("/api/users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
@ -367,8 +367,8 @@ public class UserResourceIntTest {
// Update the user
User updatedUser = userRepository.findOne(user.getId());
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
updatedUser.getId(),
UPDATED_LOGIN,
@ -383,7 +383,7 @@ public class UserResourceIntTest {
updatedUser.getCreatedDate(),
updatedUser.getLastModifiedBy(),
updatedUser.getLastModifiedDate(),
autorities);
authorities);
restUserMockMvc.perform(put("/api/users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
@ -419,13 +419,11 @@ public class UserResourceIntTest {
anotherUser.setLangKey("en");
userRepository.saveAndFlush(anotherUser);
int databaseSizeBeforeUpdate = userRepository.findAll().size();
// Update the user
User updatedUser = userRepository.findOne(user.getId());
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
updatedUser.getId(),
updatedUser.getLogin(),
@ -440,7 +438,7 @@ public class UserResourceIntTest {
updatedUser.getCreatedDate(),
updatedUser.getLastModifiedBy(),
updatedUser.getLastModifiedDate(),
autorities);
authorities);
restUserMockMvc.perform(put("/api/users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)
@ -464,13 +462,12 @@ public class UserResourceIntTest {
anotherUser.setImageUrl("");
anotherUser.setLangKey("en");
userRepository.saveAndFlush(anotherUser);
int databaseSizeBeforeUpdate = userRepository.findAll().size();
// Update the user
User updatedUser = userRepository.findOne(user.getId());
Set<String> autorities = new HashSet<>();
autorities.add("ROLE_USER");
Set<String> authorities = new HashSet<>();
authorities.add("ROLE_USER");
ManagedUserVM managedUserVM = new ManagedUserVM(
updatedUser.getId(),
"jhipster", // this login should already be used by anotherUser
@ -485,7 +482,7 @@ public class UserResourceIntTest {
updatedUser.getCreatedDate(),
updatedUser.getLastModifiedBy(),
updatedUser.getLastModifiedDate(),
autorities);
authorities);
restUserMockMvc.perform(put("/api/users")
.contentType(TestUtil.APPLICATION_JSON_UTF8)

755
yarn.lock

File diff suppressed because it is too large Load Diff