Java project for an interview request by visma
Here is the programming challenge:
Problem Description
Below, please find a simple development task which we use for new employments in the development department.
The task should be solved using Java.
The solution should be returned with full source and if possible also as an executable under Windows or on a web server accessible using MS Internet Explorer.
Programming test
Create a simple application which can be used for calculation of the cost from a housing loan.
The application should have a simple user interface where the user can specify the desired amount and the payback time in years.
For simplicity we assume a fixed interest of 5.5% per year during the complete payback time.
The interest should be connected to the loan type in such a manner that different loan types can have different interests.
When selecting amount and payback time, the application should generate a monthly payback plan based on the series loan principle, i.e. you pay back an equal amount each month and add the generated interest.
The interest is calculated every month.
The application should be made in such a manner that it can easily be extended to calculate a payment plan for other types of loans, for instance car loan, spending loan etc. with different interests. Also bear in mind that it should be easy to extend the application to cover other payback schemes as well. We do not expect this to be implemented.
Feel free to choose this being a desktop application or a web application, but we expect that you demonstrate reasonable use of the available language functionality for abstraction, interfaces, inheritance, a good class structure and show a good programming practice. We are focused on code quality and good design, so it is nice if you add a design sketch.
You will not be judged for correctness in the interest calculation or a fancy GUI:
See pre-commit
Run pre-commit install
Run pre-commit autoupdate
npm install -g htmllint-cli
htmllint
Run pre-commit run --all-files
Commit git commit -am 'TEST' --no-verify
See [takari-maven-wrapper] (https://github.com/takari/maven-wrapper)
mvn -N io.takari:maven:wrapper
The following items should be installed in your system:
- Maven 3 (http://www.sonatype.com/books/mvnref-book/reference/installation.html)
- git command line tool (https://help.github.com/articles/set-up-git)
- Eclipse with the m2e plugin (m2e is installed by default when using the STS (http://www.springsource.org/sts) distribution of Eclipse)
Note: when m2e is available, there is an m2 icon in Help -> About dialog. If m2e is not there, just follow the install process here: https://www.eclipse.org/m2e/documentation/m2e-extension-development.html
- In the command line
git clone https://github.com/AlbanAndrieu/nabla-projects-interview-visma.git
- Inside Eclipse
File -> Import -> Maven -> Existing Maven project
Run mvnw clean install -Dserver=jetty9x
for building.
mvnw clean install -Dserver=jetty9x
mvnw verify gpg:sign -Dgpg.passphrase=thephrase 2>&1 sign.log
git clone https://github.com/AlbanAndrieu/nabla-projects-interview-visma.git
cd nabla-projects-interview-visma
#./mvnw spring-boot:run
./mvnw org.codehaus.cargo:cargo-maven2-plugin:run
You can then access nabla here:
Please find below output of this sample:
TODO : The compiled, source, and Javadoc JAR files will be uploaded as downloads here.
The generated site will be committed to the gh-pages branch and visible here.
Remarks : visma installer is produced during the jenkins build , especially here. In order to install, double click on the VISMAInstaller.jar
On unix, please make sure you can execute the installer :
$ chmod 755 VISMAInstaller.jar
$ sudo ./VISMAInstaller.jar
Once installed :
$ cd /usr/local/visma-installer-1.0.1-SNAPSHOT
$ sudo chmod 755 ./run.sh
$ sudo ./run.sh start
You can find a basic GUI at http://localhost:9090/loan.xhtml Enjoy!!!
WhiteSource is providing free open source analysis solution to this project, as part of its on-going support to the open source community
In its default configuration, Nabla uses an in-memory database (HSQLDB) which gets populated at startup with data. A similar setup is provided for MySql in case a persistent database configuration is needed. Note that whenever the database type is changed, the data-access.properties file needs to be updated and the mysql-connector-java artifact from the pom.xml needs to be uncommented.
You could start a MySql database with docker:
docker run -e MYSQL_ROOT_PASSWORD=nabla -e MYSQL_DATABASE=nabla -p 3306:3306 mysql:5.7.8
git clone https://github.com/swagger-api/swagger-ui.git cd swagger-ui sudo docker build -t swagger-ui-builder . sudo docker run -p 127.0.0.1:8080:8080 swagger-ui-builder
Use spring-petclinic
Other resources can be found on my googlecode wiki:
Below resources are available from outside my network :
-
Set up your workstation : workstation
-
Set up your build environment : servers
-
Nexus : nexus
-
Phpmyadmin : phpmyadmin
Only for local users to the network :
-
Elasticsearch / Logstash / Kibana: logstash
-
Monit monitoring: monit
-
Mon monitoring: mon
-
Supervisor: supervisor
-
Statistic : awstats
-
Disk usage : philesight
On GitHub I have mostly Ansible roles.
I am trying to contribute as much as possible (instead of creating new projects). The projects I have created are shared on the Ansible repository ansible-galaxy
All the roles I am using are gathered inside a main role ansible-nabla.
The main project provides a continuous delivery build farm and everything needed for a dev, systems admin, QA, UI, or a release manager.
You will also have stuff like :
- jenkins (scheduler)
- sonar (metrics)
- nexus (repository)
- docker (provisioning)
- vagrant (provisioning)
- virtualbox (provisioning)
- logstash (monitoring)
- eclipse (with basic plugins),
- za-proxy (security)
- jmeter (performance)
- visualVM (performance)
- selenium and Xvfb (End2End test)
There is also a FrontEnd apache with mod pagespeed, fail2ban, DeniedOfService, AWStats, a Varnish load balancer, Zabbix, Mon, Monit, Supervisor, Jboss, Tomcat ready and more.
Essentially, there is a bit more than the basic tools for a production, staging, dev environment all configured to work together with as much security as possible.
My "old" project nabla which is using andromda as an UML code generator. I am now using this project more because it generates a lot of code and it is resource-demanding for my devops environment. This project is using JBoss, Seam, Hibernate, Spring,GWT, JSF, Arquillian, ... So it was quite hard to get Jacoco with mutation testing to work with it. In this repo there's also some sample projects used as ProofOfConcept
-
Database best pratices nabla-databases-integration
-
Server integration best pratices nabla-uml-integration
-
UML best pratices nabla-uml-integration
The goal is mostly to ensure that any of my code will be able to work with any database on any servers/browsers using selenium.
You're invited to have a quick look at the project below (it has some of the quality metrics that I am using at work, like unit tests, integration tests, mutation tests, performance tests, load tests, end2end tests, functional tests)
Visma is a very basic code done for an interview that you can easily install using IZPack at installer The goal is to provide an easy Maven starter with basic integration and metrics for any code interview working. The goal is also to have as many testing tools ready to work altogether (like junit, mock, selenium, cucumber). because there is always some form of incompatiblity between them... The GUI is working on jetty! It is basic, but it has coverage, debug mode, monitoring (JMX and NewRelic) and even some perf testing. The code is not yet using the best tool like REST, and AngularJS and has no database. So like this, a dev can mesure the quality of his work. It takes 1 hour to build for 1000 lines of code on an old laptop...
Writing code is just one step among many others: building, testing, documenting, releasing, packaging, deploying, monitoring
Thanks for reading!
The issue tracker is the preferred channel for bug reports, features requests and submitting pull requests.
For pull requests, editor preferences are available in the editor config for easy use in common text editors. Read more and download plugins at http://editorconfig.org.
Alban Andrieu linkedin