Skip to content

Commit

Permalink
automatic project update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdubois committed Dec 1, 2015
1 parent 653e4d3 commit 38fdfc1
Show file tree
Hide file tree
Showing 692 changed files with 41,011 additions and 26,849 deletions.
20 changes: 2 additions & 18 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Generated on 2015-11-20 using generator-jhipster 2.24.0
// Generated on 2015-12-01 using generator-jhipster 2.24.0
'use strict';
var fs = require('fs');

Expand Down Expand Up @@ -269,22 +269,6 @@ module.exports = function (grunt) {
singleRun: true
}
},
protractor: {
options: {
configFile: 'src/test/javascript/protractor.conf.js'
},
e2e: {
options: {
// Stops Grunt process if a test fails
keepAlive: false
}
},
continuous: {
options: {
keepAlive: true
}
}
},
ngAnnotate: {
dist: {
files: [{
Expand Down Expand Up @@ -390,6 +374,6 @@ module.exports = function (grunt) {
'buildcontrol:openshift'
]);

grunt.registerTask('itest', ['protractor:continuous']);

grunt.registerTask('default', ['serve']);
};
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ Then navigate to [http://localhost:8080](http://localhost:8080) in your browser.
Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in `src/test/javascript` and can be run with:

grunt test

UI end-to-end tests are powered by [Protractor][], which is built on top of WebDriverJS. They're located in `src/test/javascript/e2e`
and can be run by starting Spring Boot in one terminal (`mvn spring-boot:run`) and running the tests (`grunt itest`) in a second one.



# Continuous Integration

Expand All @@ -63,16 +62,8 @@ To setup this project in Jenkins, use the following configuration:
* Poll SCM / Schedule: `H/5 * * * *`
* Build
* Invoke Maven / Tasks: `-Pprod clean package`
* Execute Shell / Command:
````
mvn spring-boot:run &
bootPid=$!
sleep 30s
grunt itest
kill $bootPid
````
* Post-build Actions
* Publish JUnit test result report / Test Report XMLs: `build/test-results/*.xml,build/reports/e2e/*.xml`
* Publish JUnit test result report / Test Report XMLs: `build/test-results/*.xml`

[JHipster]: https://jhipster.github.io/
[Node.js]: https://nodejs.org/
Expand Down
42 changes: 21 additions & 21 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@
"appPath": "src/main/webapp",
"testPath": "src/test/javascript/spec",
"dependencies": {
"angular": "1.4.5",
"angular-aria": "1.4.5",
"angular-bootstrap": "0.13.3",
"angular": "1.4.8",
"angular-aria": "1.4.8",
"angular-bootstrap": "0.14.3",
"angular-cache-buster": "0.4.3",
"angular-cookies": "1.4.5",
"angular-dynamic-locale": "0.1.27",
"angular-i18n": "1.4.5",
"angular-local-storage": "0.2.2",
"angular-cookies": "1.4.8",
"angular-dynamic-locale": "0.1.28",
"angular-i18n": "1.4.8",
"angular-local-storage": "0.2.3",
"angular-loading-bar": "0.8.0",
"angular-resource": "1.4.5",
"angular-sanitize": "1.4.5",
"angular-translate": "2.7.2",
"angular-translate-interpolation-messageformat": "2.7.2",
"angular-translate-loader-partial": "2.7.2",
"angular-translate-storage-cookie": "2.7.2",
"angular-resource": "1.4.8",
"angular-sanitize": "1.4.8",
"angular-translate": "2.8.1",
"angular-translate-interpolation-messageformat": "2.8.1",
"angular-translate-loader-partial": "2.8.1",
"angular-translate-storage-cookie": "2.8.1",
"angular-ui-router": "0.2.15",
"bootstrap": "3.3.5",
"jquery": "2.1.4",
"json3": "3.3.2",
"modernizr": "2.8.3",
"ng-file-upload": "7.0.17",
"ngInfiniteScroll": "1.2.0",
"swagger-ui": "2.1.2"
"modernizr": "3.2.0",
"ng-file-upload": "10.0.2",
"ngInfiniteScroll": "1.2.1",
"swagger-ui": "2.1.3"
},
"devDependencies": {
"angular-mocks": "1.4.5",
"angular-scenario": "1.4.5"
"angular-mocks": "1.4.8",
"angular-scenario": "1.4.8"
},
"overrides": {
"bootstrap": {
Expand All @@ -42,8 +42,8 @@
}
},
"resolutions": {
"angular": "1.4.5",
"angular-cookies": "1.4.5",
"angular": "1.4.8",
"angular-cookies": "1.4.8",
"jquery": "2.1.4"
}
}
25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,37 @@
"src/main/webapp/bower_components"
],
"dependencies": {
"bower": "^1.6.3",
"protractor": "^2.5.1"
"bower": "^1.6.3"
},
"devDependencies": {
"grunt": "0.4.5",
"grunt-autoprefixer": "3.0.3",
"grunt-build-control": "0.6.1",
"grunt-wiredep": "2.0.0",
"grunt-browser-sync": "2.1.3",
"browser-sync": "2.9.12",
"grunt-browser-sync": "2.2.0",
"browser-sync": "2.10.0",
"grunt-contrib-copy": "0.8.2",
"grunt-contrib-clean": "0.6.0",
"grunt-contrib-clean": "0.7.0",
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-cssmin": "0.14.0",
"grunt-contrib-htmlmin": "0.6.0",
"grunt-contrib-imagemin": "0.9.4",
"grunt-contrib-imagemin": "1.0.0",
"grunt-contrib-jshint": "0.11.3",
"grunt-contrib-uglify": "0.10.0",
"grunt-contrib-uglify": "0.10.1",
"grunt-contrib-watch": "0.6.1",
"grunt-modernizr": "1.0.1",
"grunt-ng-annotate": "1.0.1",
"grunt-ng-constant": "1.1.0",
"grunt-rev": "0.1.0",
"grunt-svgmin": "2.0.1",
"grunt-svgmin": "3.1.0",
"grunt-text-replace": "0.4.0",
"grunt-usemin": "3.1.1",
"grunt-angular-templates":"0.5.7",
"load-grunt-tasks": "3.3.0",
"grunt-karma": "0.12.1",
"grunt-protractor-runner": "2.1.0",
"jasmine-reporters": "^2.0.6",
"protractor-jasmine2-screenshot-reporter": "0.1.7",
"time-grunt": "1.2.2",
"event-stream": "3.3.2",
"jshint-stylish": "2.0.1",
"jshint-stylish": "2.1.0",
"karma-script-launcher": "0.1.0",
"karma-chrome-launcher": "0.2.1",
"karma-html2js-preprocessor": "0.1.0",
Expand All @@ -51,7 +47,7 @@
"karma-phantomjs-launcher": "0.2.1",
"phantomjs": "1.9.18",
"karma": "0.13.15",
"karma-coverage": "0.4.2",
"karma-coverage": "0.5.3",
"karma-jenkins-reporter": "0.0.2",
"generator-jhipster": "2.24.0",
"lodash": "3.10.1",
Expand All @@ -66,7 +62,6 @@
"node": "^0.12 || ^4.2"
},
"scripts": {
"test": "grunt test",
"postinstall": "webdriver-manager update"
"test": "grunt test"
}
}
1 change: 1 addition & 0 deletions src/main/java/com/mycompany/myapp/domain/BankAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class BankAccount implements Serializable {
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Operation> operations = new HashSet<>();


public Long getId() {
return id;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/mycompany/myapp/domain/Label.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class Label implements Serializable {
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<Operation> operations = new HashSet<>();


public Long getId() {
return id;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/mycompany/myapp/domain/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class Operation implements Serializable {
inverseJoinColumns = @JoinColumn(name="labels_id", referencedColumnName="ID"))
private Set<Label> labels = new HashSet<>();


public Long getId() {
return id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ public ResponseEntity<UserDTO> getAccount() {
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public ResponseEntity<String> saveAccount(@RequestBody UserDTO userDTO) {
Optional<User> existingUser = userRepository.findOneByEmail(userDTO.getEmail());
if (existingUser.isPresent() && (!existingUser.get().getLogin().equalsIgnoreCase(userDTO.getLogin()))) {
return ResponseEntity.badRequest().header("Failure", "Email already used").body(null);
}
return userRepository
.findOneByLogin(SecurityUtils.getCurrentUser().getUsername())
.map(u -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
public class BankAccountResource {

private final Logger log = LoggerFactory.getLogger(BankAccountResource.class);

@Inject
private BankAccountRepository bankAccountRepository;

/**
* POST /bankAccounts -> Create a new bankAccount.
*/
Expand Down Expand Up @@ -77,8 +77,8 @@ public ResponseEntity<BankAccount> updateBankAccount(@Valid @RequestBody BankAcc
public List<BankAccount> getAllBankAccounts() {
log.debug("REST request to get all BankAccounts");
return bankAccountRepository.findAll();
}

}
/**
* GET /bankAccounts/:id -> get the "id" bankAccount.
*/
Expand All @@ -88,9 +88,10 @@ public List<BankAccount> getAllBankAccounts() {
@Timed
public ResponseEntity<BankAccount> getBankAccount(@PathVariable Long id) {
log.debug("REST request to get BankAccount : {}", id);
return Optional.ofNullable(bankAccountRepository.findOne(id))
.map(bankAccount -> new ResponseEntity<>(
bankAccount,
BankAccount bankAccount = bankAccountRepository.findOne(id);
return Optional.ofNullable(bankAccount)
.map(result -> new ResponseEntity<>(
result,
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/com/mycompany/myapp/web/rest/LabelResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
public class LabelResource {

private final Logger log = LoggerFactory.getLogger(LabelResource.class);

@Inject
private LabelRepository labelRepository;

/**
* POST /labels -> Create a new label.
*/
Expand Down Expand Up @@ -77,8 +77,8 @@ public ResponseEntity<Label> updateLabel(@Valid @RequestBody Label label) throws
public List<Label> getAllLabels() {
log.debug("REST request to get all Labels");
return labelRepository.findAll();
}

}
/**
* GET /labels/:id -> get the "id" label.
*/
Expand All @@ -88,9 +88,10 @@ public List<Label> getAllLabels() {
@Timed
public ResponseEntity<Label> getLabel(@PathVariable Long id) {
log.debug("REST request to get Label : {}", id);
return Optional.ofNullable(labelRepository.findOne(id))
.map(label -> new ResponseEntity<>(
label,
Label label = labelRepository.findOne(id);
return Optional.ofNullable(label)
.map(result -> new ResponseEntity<>(
result,
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
public class OperationResource {

private final Logger log = LoggerFactory.getLogger(OperationResource.class);

@Inject
private OperationRepository operationRepository;

/**
* POST /operations -> Create a new operation.
*/
Expand Down Expand Up @@ -79,11 +79,12 @@ public ResponseEntity<Operation> updateOperation(@Valid @RequestBody Operation o
@Timed
public ResponseEntity<List<Operation>> getAllOperations(Pageable pageable)
throws URISyntaxException {
Page<Operation> page = operationRepository.findAll(pageable);
log.debug("REST request to get a page of Operations");
Page<Operation> page = operationRepository.findAll(pageable);
HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/operations");
return new ResponseEntity<>(page.getContent(), headers, HttpStatus.OK);
}

/**
* GET /operations/:id -> get the "id" operation.
*/
Expand All @@ -93,9 +94,10 @@ public ResponseEntity<List<Operation>> getAllOperations(Pageable pageable)
@Timed
public ResponseEntity<Operation> getOperation(@PathVariable Long id) {
log.debug("REST request to get Operation : {}", id);
return Optional.ofNullable(operationRepository.findOneWithEagerRelationships(id))
.map(operation -> new ResponseEntity<>(
operation,
Operation operation = operationRepository.findOneWithEagerRelationships(id);
return Optional.ofNullable(operation)
.map(result -> new ResponseEntity<>(
result,
HttpStatus.OK))
.orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND));
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/mycompany/myapp/web/rest/UserResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public ResponseEntity<User> createUser(@RequestBody User user) throws URISyntaxE
@Secured(AuthoritiesConstants.ADMIN)
public ResponseEntity<ManagedUserDTO> updateUser(@RequestBody ManagedUserDTO managedUserDTO) throws URISyntaxException {
log.debug("REST request to update User : {}", managedUserDTO);
Optional<User> existingUser = userRepository.findOneByEmail(managedUserDTO.getEmail());
if (existingUser.isPresent() && (!existingUser.get().getLogin().equalsIgnoreCase(managedUserDTO.getLogin()))) {
return ResponseEntity.badRequest().header("Failure", "Email already used").body(null);
}
return userRepository
.findOneById(managedUserDTO.getId())
.map(user -> {
Expand All @@ -118,6 +122,7 @@ public ResponseEntity<ManagedUserDTO> updateUser(@RequestBody ManagedUserDTO man
.findOne(managedUserDTO.getId())));
})
.orElseGet(() -> new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR));

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public static HttpHeaders generatePaginationHttpHeaders(Page<?> page, String bas
link += "<" + (new URI(baseUrl +"?page=" + (page.getNumber() - 1) + "&size=" + page.getSize())).toString() + ">; rel=\"prev\",";
}
// last and first link
link += "<" + (new URI(baseUrl +"?page=" + (page.getTotalPages() - 1) + "&size=" + page.getSize())).toString() + ">; rel=\"last\",";
int lastPage = 0;
if (page.getTotalPages() > 0) {
lastPage = page.getTotalPages() - 1;
}
link += "<" + (new URI(baseUrl +"?page=" + lastPage + "&size=" + page.getSize())).toString() + ">; rel=\"last\",";
link += "<" + (new URI(baseUrl +"?page=" + 0 + "&size=" + page.getSize())).toString() + ">; rel=\"first\"";
headers.add(HttpHeaders.LINK, link);
return headers;
Expand Down
Loading

0 comments on commit 38fdfc1

Please sign in to comment.