Skip to content

Commit

Permalink
Merge pull request lutece-secteur-public#29 from jrmartino/RENDEZVOUS…
Browse files Browse the repository at this point in the history
…-454

test updates
  • Loading branch information
jrmartino authored Oct 27, 2020
2 parents 2c5e7cf + aab27fe commit 71d464a
Show file tree
Hide file tree
Showing 8 changed files with 140 additions and 121 deletions.
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: '2'

services:
mysql-test:
container_name: mysql-lutece-test
image: mysql:8
env_file: .env
restart: always
# The native password plugin is required by the lutece container entrypoint script
command: mysqld --default-authentication-plugin=mysql_native_password --skip-mysqlx
ports:
- "3306:3306"
volumes:
- db:/var/lib/mysql
- ./.secrets/:/run/secrets/

volumes:
db:
driver: local
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public Appointment findByReference( String strReference, Plugin plugin )
@Override
public List<Appointment> findByFilter( AppointmentFilterDTO appointmentFilter, Plugin plugin )
{
List<Appointment> listAppointment = new ArrayList<Appointment>( );
List<Appointment> listAppointment = new ArrayList<>();
DAOUtil daoUtil = new DAOUtil( getSqlQueryFromFilter( appointmentFilter ), plugin );
addFilterParametersToDAOUtil( appointmentFilter, daoUtil );
daoUtil.executeQuery( );
Expand Down Expand Up @@ -431,7 +431,7 @@ private Appointment buildAppointmentHeavy( DAOUtil daoUtil )
/**
* Build a daoUtil object with the query and all the attributes of the Appointment
*
* @param suery
* @param query
* the query
* @param appointment
* the Appointment
Expand All @@ -445,7 +445,7 @@ private Appointment buildAppointmentHeavy( DAOUtil daoUtil )
private DAOUtil buildDaoUtil( String query, Appointment appointment, Plugin plugin, boolean isInsert )
{
int nIndex = 1;
DAOUtil daoUtil = null;
DAOUtil daoUtil;
if ( isInsert )
{
daoUtil = new DAOUtil( query, Statement.RETURN_GENERATED_KEYS, plugin );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void testAppointmentAndNbRemainingPlaces( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 1, 1, 0, 1,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 1, 1, 0, 1,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -55,7 +55,7 @@ public void testAppointmentAndNbRemainingPlaces2( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -85,7 +85,7 @@ public void testAppointmentAndNbRemainingPlaces3( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -115,7 +115,7 @@ public void testAppointmentAndNbPotentialRemainingPlaces( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 1, 1, 0, 1,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 1, 1, 0, 1,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -145,7 +145,7 @@ public void testAppointmentAndNbPotentialRemainingPlaces2( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -176,7 +176,7 @@ public void testAppointmentAndNbPotentialRemainingPlaces3( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -206,7 +206,7 @@ public void testAppointmentAndNbPlacesTaken( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 1, 1, 0, 1,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 1, 1, 0, 1,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -236,7 +236,7 @@ public void testAppointmentAndNbPlacesTaken2( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -266,7 +266,7 @@ public void testAppointmentAndNbPlacesTaken3( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -296,7 +296,7 @@ public void testMultipleAppointmentsOnSameSlot( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -338,7 +338,7 @@ public void testMultipleAppointmentsOnSameSlot2( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 3, 3, 0, 3,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 3, 3, 0, 3,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -379,7 +379,7 @@ public void testMultipleAppointmentsOnSameSlot3( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 3, 3, 0, 3,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 3, 3, 0, 3,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -419,7 +419,7 @@ public void testRemoveAppointmentAndCheckNbRemainingPlaces( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 1, 1, 0, 1,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 1, 1, 0, 1,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -455,7 +455,7 @@ public void testRemoveAppointmentAndCheckNbRemainingPlaces2( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -491,7 +491,7 @@ public void testRemoveAppointmentAndCheckNbRemainingPlaces3( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -538,7 +538,7 @@ public void testRemoveAppointmentAndCheckNbRemainingPlaces4( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 3, 3, 0, 3,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 3, 3, 0, 3,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -585,7 +585,7 @@ public void testCancelAppointment( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -624,7 +624,7 @@ public void testCancelAppointment2( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 2, 2, 0, 2,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 2, 2, 0, 2,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down Expand Up @@ -674,7 +674,7 @@ public void testCancelAppointment3( )
// Build the form
int nIdForm = FormService.createAppointmentForm( FormServiceTest.buildAppointmentForm( ) );

Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2018-12-03T10:00" ), LocalDateTime.parse( "2018-12-03T10:30" ), 3, 3, 0, 3,
Slot slot = SlotTest.buildSlot( nIdForm, LocalDateTime.parse( "2022-12-03T10:00" ), LocalDateTime.parse( "2022-12-03T10:30" ), 3, 3, 0, 3,
Boolean.TRUE, Boolean.TRUE );
slot = SlotService.saveSlot( slot );

Expand Down
Loading

0 comments on commit 71d464a

Please sign in to comment.