Skip to content

AlbanAndrieu/nabla-projects-interview-visma

Repository files navigation

Nabla nabla-projects-interview-visma

License Gitter

Java project for an interview request by visma

Build

Travis Build Status

Quality

Quality Gate

js-standard-style

Code Climate Test Coverage

Info

Minimal java version Maven Central

Branch Platform Platform Platform Platform

Last deployed

Contributing contributions welcome bounties

GitHub issues by-label GitHub pull requests by-label

Table of contents

Why? start with why

Website

The challenge

Here is the programming challenge:

Payment schedule

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:

Quality tools

pre-commit

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

takari maven wrapper

See [takari-maven-wrapper] (https://github.com/takari/maven-wrapper)

mvn -N io.takari:maven:wrapper

Working with Nabla in Eclipse/STS

prerequisites

The following items should be installed in your system:

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

Steps:

  1. In the command line
git clone https://github.com/AlbanAndrieu/nabla-projects-interview-visma.git
  1. Inside Eclipse
File -> Import -> Maven -> Existing Maven project

Build & development

Run mvnw clean install -Dserver=jetty9x for building.

mvnw clean install -Dserver=jetty9x
mvnw verify gpg:sign -Dgpg.passphrase=thephrase 2>&1 sign.log

Running nabla locally

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:

Screenshot

testWithWrongInputS

testWithGoodInputS

Result

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 security tests

WhiteSource is providing free open source analysis solution to this project, as part of its on-going support to the open source community

Database configuration

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

Swagger REST

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

http://localhost:8080

http://online.swagger.io/

http://editor.swagger.io/#/

TODO

Use spring-petclinic

My resources

Other resources can be found on my googlecode wiki:

Below resources are available from outside my network :

Only for local users to the network :


My opensource projects

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 :

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

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.


VISMA : An opensource project to showcase best pratices

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!

Contributing

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.

License

Apache v2


Alban Andrieu linkedin