IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Spring Java Discussion :

Retour de Statut et Pointeur null dans controlleur Rest


Sujet :

Spring Java

  1. #1
    Membre éprouvé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Août 2011
    Messages
    756
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Août 2011
    Messages : 756
    Par défaut Retour de Statut et Pointeur null dans controlleur Rest
    Bonjour,

    j'essaie de faire passer les tests suivants (qui sont fournis et qui fonctionne) :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    package friendsofmine.m2;
     
    import friendsofmine.m2.domain.*;
    import friendsofmine.m2.services.InscriptionService;
    import org.junit.Test;
    import org.junit.runner.RunWith;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
    import org.springframework.boot.test.context.SpringBootTest;
    import org.springframework.http.MediaType;
    import org.springframework.test.context.junit4.SpringRunner;
    import org.springframework.test.web.servlet.MockMvc;
    import org.springframework.transaction.annotation.Transactional;
     
    import java.nio.charset.Charset;
     
    import static org.hamcrest.Matchers.*;
    import static org.junit.Assert.assertEquals;
    import static org.junit.Assert.assertNull;
    import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
    import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
     
    @RunWith(SpringRunner.class)
    @SpringBootTest
    @AutoConfigureMockMvc
    @Transactional
    public class InscriptionControllerIntegrationTest {
     
        @Autowired
        private MockMvc mockMvc;
     
        @Autowired
        private InscriptionService inscriptionService;
     
        @Autowired
        private DataLoader dataLoader;
     
        private MediaType contentType = new MediaType(MediaType.APPLICATION_JSON.getType(),
                MediaType.APPLICATION_JSON.getSubtype(),
                Charset.forName("utf8"));
     
        @Test
        public void testShowInscriptionExistante() throws Exception {
            // ATTENTION : ICI VOUS AVEZ LE DROIT DE MODIFIER LE TEST !
            // changez l'inscription récupérée dans le dataLoader
            // en fonction des inscriptions que vous y avez créées
            // given: une inscription du DataLoader
            Inscription thomOnPingpong = dataLoader.getThomAuPingPong();
     
            // when: une requète est émise pour obtenir le détail d'une inscription
            mockMvc.perform(get("/api/inscription/" + thomOnPingpong.getId()))
                    // then: la réponse a le status 200(OK)
                    .andExpect(status().isOk())
                    // then: la réponse est en utf8
                    .andExpect(content().contentType(contentType))
                    // then: la réponse est au format JSON et comporte les infos sur l'inscription
                    .andExpect(jsonPath("$.id", is(thomOnPingpong.getId().intValue())))
                    .andExpect(jsonPath("$.participant.nom", is(thomOnPingpong.getParticipant().getNom())))
                    .andExpect(jsonPath("$.activite.titre", is(thomOnPingpong.getActivite().getTitre())));
        }
     
        @Test
        public void testShowInscriptionInexistante() throws Exception {
     
            // assert: l'id suivant ne correspond à aucune inscription en base
            Long idInexistant = 12345L;
            assertNull(inscriptionService.findInscriptionById(idInexistant));
     
            // when: une requète est émise pour obtenir le détail d'une inscription inexistante
            mockMvc.perform(get("/api/inscription/" + idInexistant))
                    // then: la réponse a le status 404
                    .andExpect(status().isNotFound());
        }
     
        @Test
        public void testAjoutInscription() throws Exception {
     
            // ATTENTION : ICI VOUS AVEZ LE DROIT DE MODIFIER LE TEST !
            // changez l'utilisateur  et l'activité récupérés dans le dataLoader
            // en fonction des données que vous y avez créées
            // given: une activité et un utilisateur du DataLoader
            Utilisateur ed = dataLoader.getEd();
            Activite pingpong = dataLoader.getPingpong();
     
            // when: une requète est émise pour créer une nouvelle inscription de l'utilisateur précédent à l'activite précédente
            mockMvc.perform(post("/api/inscription?utilisateur_id=" + ed.getId() + "&activite_id=" + pingpong.getId()))
                    // then: la réponse a le status 201 (CREATED)
                    .andExpect(status().isCreated())
                    // then: la réponse est en utf8
                    .andExpect(content().contentType(contentType))
                    // then: la réponse est au format JSON et comporte les infos sur l'inscription
                    .andExpect(jsonPath("$.participant.nom", is(ed.getNom())))
                    .andExpect(jsonPath("$.activite.titre", is(pingpong.getTitre())));
        }
     
        @Test
        public void testDeleteInscription() throws Exception {
            // ATTENTION : ICI VOUS AVEZ LE DROIT DE MODIFIER LE TEST !
            // changez l'inscription récupérée dans le dataLoader
            // en fonction des inscriptions que vous y avez créées
            // given: une inscription du DataLoader
            Inscription thomOnPingpong = dataLoader.getThomAuPingPong();
            Long count = inscriptionService.countInscription();
     
            // when: une requète de suppression est émise
            mockMvc.perform(delete("/api/inscription/" + thomOnPingpong.getId()))
                    // then: la supression est effectuée avec succès
                    .andExpect(status().isOk());
     
            // then: le nombre d'inscription a diminué de 1
            assertEquals(count - 1, inscriptionService.countInscription());
        }
     
    }
    Ce qui me génère les erreurs suivantes:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
     
     .   ____          _            __ _ _
     /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
    ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
     \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
      '  |____| .__|_| |_|_| |_\__, | / / / /
     =========|_|==============|___/=/_/_/_/
     :: Spring Boot ::        (v2.0.5.RELEASE)
     
    2018-11-08 13:28:33.375  INFO 2421 --- [           main] f.m.InscriptionControllerIntegrationTest : Starting InscriptionControllerIntegrationTest on long-Latitude-5580 with PID 2421 (started by long in /home/long/IdeaProjects/201819-devop-j2ee-Minirock)
    2018-11-08 13:28:33.377  INFO 2421 --- [           main] f.m.InscriptionControllerIntegrationTest : No active profile set, falling back to default profiles: default
    2018-11-08 13:28:33.400  INFO 2421 --- [           main] o.s.w.c.s.GenericWebApplicationContext   : Refreshing org.springframework.web.context.support.GenericWebApplicationContext@14dd7b39: startup date [Thu Nov 08 13:28:33 CET 2018]; root of context hierarchy
    2018-11-08 13:28:34.783  INFO 2421 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.ws.config.annotation.DelegatingWsConfiguration' of type [org.springframework.ws.config.annotation.DelegatingWsConfiguration$$EnhancerBySpringCGLIB$$da5aee6] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2018-11-08 13:28:34.820  INFO 2421 --- [           main] .w.s.a.s.AnnotationActionEndpointMapping : Supporting [WS-Addressing August 2004, WS-Addressing 1.0]
    2018-11-08 13:28:34.841  INFO 2421 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$690de9e7] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2018-11-08 13:28:34.870  INFO 2421 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.hateoas.config.HateoasConfiguration' of type [org.springframework.hateoas.config.HateoasConfiguration$$EnhancerBySpringCGLIB$$e88e3719] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2018-11-08 13:28:35.043  INFO 2421 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
    2018-11-08 13:28:35.233  INFO 2421 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
    2018-11-08 13:28:35.283  INFO 2421 --- [           main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
    2018-11-08 13:28:35.299  INFO 2421 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    	name: default
    	...]
    2018-11-08 13:28:35.352  INFO 2421 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate Core {5.2.17.Final}
    2018-11-08 13:28:35.353  INFO 2421 --- [           main] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
    2018-11-08 13:28:35.382  INFO 2421 --- [           main] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
    2018-11-08 13:28:35.466  INFO 2421 --- [           main] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
    2018-11-08 13:28:35.909 DEBUG 2421 --- [           main] org.hibernate.SQL                        : drop table activite if exists
    2018-11-08 13:28:35.911 DEBUG 2421 --- [           main] org.hibernate.SQL                        : drop table inscription if exists
    2018-11-08 13:28:35.912 DEBUG 2421 --- [           main] org.hibernate.SQL                        : drop table utilisateur if exists
    2018-11-08 13:28:35.912 DEBUG 2421 --- [           main] org.hibernate.SQL                        : drop sequence if exists hibernate_sequence
    2018-11-08 13:28:35.914 DEBUG 2421 --- [           main] org.hibernate.SQL                        : create sequence hibernate_sequence start with 1 increment by 1
    2018-11-08 13:28:35.915 DEBUG 2421 --- [           main] org.hibernate.SQL                        : create table activite (id bigint not null, description varchar(255), titre varchar(255) not null, responsable_id bigint not null, primary key (id))
    2018-11-08 13:28:35.918 DEBUG 2421 --- [           main] org.hibernate.SQL                        : create table inscription (id bigint not null, date_inscription timestamp, activite_id bigint not null, participant_id bigint not null, primary key (id))
    2018-11-08 13:28:35.919 DEBUG 2421 --- [           main] org.hibernate.SQL                        : create table utilisateur (id bigint not null, mail varchar(255) not null, nom varchar(255) not null, prenom varchar(255) not null, sexe varchar(255) not null, primary key (id))
    2018-11-08 13:28:35.920 DEBUG 2421 --- [           main] org.hibernate.SQL                        : alter table activite add constraint FKgnpjy1pypxq7xr0w3v9q39lrv foreign key (responsable_id) references utilisateur
    2018-11-08 13:28:35.926 DEBUG 2421 --- [           main] org.hibernate.SQL                        : alter table inscription add constraint FKrl273glbesxbr4o4lg7k7kla foreign key (activite_id) references activite
    2018-11-08 13:28:35.928 DEBUG 2421 --- [           main] org.hibernate.SQL                        : alter table inscription add constraint FKs3o8j8be0pnl7232ml8y6tq7r foreign key (participant_id) references utilisateur
    2018-11-08 13:28:35.930  INFO 2421 --- [           main] o.h.t.schema.internal.SchemaCreatorImpl  : HHH000476: Executing import script 'org.hibernate.tool.schema.internal.exec.ScriptSourceInputNonExistentImpl@4e140497'
    2018-11-08 13:28:35.932  INFO 2421 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
    2018-11-08 13:28:36.521  INFO 2421 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
    2018-11-08 13:28:36.846  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.web.context.support.GenericWebApplicationContext@14dd7b39: startup date [Thu Nov 08 13:28:33 CET 2018]; root of context hierarchy
    2018-11-08 13:28:36.891  WARN 2421 --- [           main] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
    2018-11-08 13:28:36.921  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/activitesWithResponsable]}" onto public java.util.ArrayList<friendsofmine.m2.domain.Activite> friendsofmine.m2.controllers.ActiviteController.findAllActvitesWithResponsable()
    2018-11-08 13:28:36.923  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/inscription/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity friendsofmine.m2.controllers.InscriptionController.findInscriptionById(long)
    2018-11-08 13:28:36.924  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/inscription],methods=[POST]}" onto public friendsofmine.m2.domain.Inscription friendsofmine.m2.controllers.InscriptionController.createInscription(long,long)
    2018-11-08 13:28:36.924  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/api/inscription/{id}],methods=[DELETE]}" onto public void friendsofmine.m2.controllers.InscriptionController.deleteInscriptionById(long)
    2018-11-08 13:28:36.927  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    2018-11-08 13:28:36.927  INFO 2421 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
    2018-11-08 13:28:36.956  INFO 2421 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
    2018-11-08 13:28:36.956  INFO 2421 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
    2018-11-08 13:28:37.052  INFO 2421 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
    2018-11-08 13:28:37.311  INFO 2421 --- [           main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring FrameworkServlet ''
    2018-11-08 13:28:37.311  INFO 2421 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : FrameworkServlet '': initialization started
    2018-11-08 13:28:37.322  INFO 2421 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : FrameworkServlet '': initialization completed in 11 ms
    2018-11-08 13:28:37.360  INFO 2421 --- [           main] f.m.InscriptionControllerIntegrationTest : Started InscriptionControllerIntegrationTest in 4.343 seconds (JVM running for 5.123)
    2018-11-08 13:28:37.383 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.404 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.405 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.405 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.407 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.408 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.408 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.408 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.409 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.409 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.409 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.410 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.410 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.411 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.412 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.413 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.414 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.414 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.415 DEBUG 2421 --- [           main] org.hibernate.SQL                        : call next value for hibernate_sequence
    2018-11-08 13:28:37.445 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into utilisateur (mail, nom, prenom, sexe, id) values (?, ?, ?, ?, ?)
    2018-11-08 13:28:37.448 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into utilisateur (mail, nom, prenom, sexe, id) values (?, ?, ?, ?, ?)
    2018-11-08 13:28:37.449 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into utilisateur (mail, nom, prenom, sexe, id) values (?, ?, ?, ?, ?)
    2018-11-08 13:28:37.450 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into utilisateur (mail, nom, prenom, sexe, id) values (?, ?, ?, ?, ?)
    2018-11-08 13:28:37.450 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.451 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.452 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.452 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.453 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.453 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.454 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.454 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.455 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.455 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into activite (description, responsable_id, titre, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.456 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into inscription (activite_id, date_inscription, participant_id, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.459 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into inscription (activite_id, date_inscription, participant_id, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.459 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into inscription (activite_id, date_inscription, participant_id, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.460 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into inscription (activite_id, date_inscription, participant_id, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.460 DEBUG 2421 --- [           main] org.hibernate.SQL                        : insert into inscription (activite_id, date_inscription, participant_id, id) values (?, ?, ?, ?)
    2018-11-08 13:28:37.490  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Began transaction (1) for test context [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@5f935d49, testMethod = testDeleteInscription@InscriptionControllerIntegrationTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@615e83ac]; rollback [true]
    2018-11-08 13:28:37.571  INFO 2421 --- [           main] o.h.h.i.QueryTranslatorFactoryInitiator  : HHH000397: Using ASTQueryTranslatorFactory
    2018-11-08 13:28:37.653 DEBUG 2421 --- [           main] org.hibernate.SQL                        : select count(*) as col_0_0_ from inscription inscriptio0_
    2018-11-08 13:28:37.687  WARN 2421 --- [           main] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'long'; nested exception is java.lang.NumberFormatException: For input string: "null"]
     
    MockHttpServletRequest:
          HTTP Method = DELETE
          Request URI = /api/inscription/null
           Parameters = {}
              Headers = {}
                 Body = null
        Session Attrs = {}
     
    Handler:
                 Type = friendsofmine.m2.controllers.InscriptionController
               Method = public void friendsofmine.m2.controllers.InscriptionController.deleteInscriptionById(long)
     
    Async:
        Async started = false
         Async result = null
     
    Resolved Exception:
                 Type = org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
     
    ModelAndView:
            View name = null
                 View = null
                Model = null
     
    FlashMap:
           Attributes = null
     
    MockHttpServletResponse:
               Status = 400
        Error message = null
              Headers = {}
         Content type = null
                 Body = 
        Forwarded URL = null
       Redirected URL = null
              Cookies = []
    2018-11-08 13:28:37.706  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Rolled back transaction for test: [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@5f935d49, testMethod = testDeleteInscription@InscriptionControllerIntegrationTest, testException = java.lang.AssertionError: Status expected:<200> but was:<400>, mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]
     
    java.lang.AssertionError: Status 
    Expected :200
    Actual   :400
     <Click to see difference>
     
     
    	at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:55)
    	at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:82)
    	at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:619)
    	at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:178)
    	at friendsofmine.m2.InscriptionControllerIntegrationTest.testDeleteInscription(InscriptionControllerIntegrationTest.java:108)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)
    	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
     
    2018-11-08 13:28:37.856  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Began transaction (1) for test context [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@542ff147, testMethod = testShowInscriptionInexistante@InscriptionControllerIntegrationTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@615e83ac]; rollback [true]
    2018-11-08 13:28:37.861 DEBUG 2421 --- [           main] org.hibernate.SQL                        : select inscriptio0_.id as id1_1_0_, inscriptio0_.activite_id as activite3_1_0_, inscriptio0_.date_inscription as date_ins2_1_0_, inscriptio0_.participant_id as particip4_1_0_, activite1_.id as id1_0_1_, activite1_.description as descript2_0_1_, activite1_.responsable_id as responsa4_0_1_, activite1_.titre as titre3_0_1_, utilisateu2_.id as id1_2_2_, utilisateu2_.mail as mail2_2_2_, utilisateu2_.nom as nom3_2_2_, utilisateu2_.prenom as prenom4_2_2_, utilisateu2_.sexe as sexe5_2_2_ from inscription inscriptio0_ inner join activite activite1_ on inscriptio0_.activite_id=activite1_.id inner join utilisateur utilisateu2_ on inscriptio0_.participant_id=utilisateu2_.id where inscriptio0_.id=?
     
    MockHttpServletRequest:
          HTTP Method = DELETE
          Request URI = /api/inscription/null
           Parameters = {}
              Headers = {}
                 Body = null
        Session Attrs = {}
     
    Handler:
                 Type = friendsofmine.m2.controllers.InscriptionController
               Method = public void friendsofmine.m2.controllers.InscriptionController.deleteInscriptionById(long)
     
    Async:
        Async started = false
         Async result = null
     
    Resolved Exception:
                 Type = org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
     
    ModelAndView:
            View name = null
                 View = null
                Model = null
     
    FlashMap:
           Attributes = null
     
    MockHttpServletResponse:
               Status = 400
        Error message = null
              Headers = {}
         Content type = null
                 Body = 
        Forwarded URL = null
       Redirected URL = null
              Cookies = []
    2018-11-08 13:28:37.873  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Rolled back transaction for test: [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@542ff147, testMethod = testShowInscriptionInexistante@InscriptionControllerIntegrationTest, testException = org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException, mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]
     
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
     
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
    	at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:71)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:166)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:165)
    	at friendsofmine.m2.InscriptionControllerIntegrationTest.testShowInscriptionInexistante(InscriptionControllerIntegrationTest.java:70)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)
    	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    Caused by: java.lang.NullPointerException
    	at friendsofmine.m2.controllers.InscriptionController.findInscriptionById(InscriptionController.java:72)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
    	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
    	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
    	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
    	... 51 more
     
    2018-11-08 13:28:37.877  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Began transaction (1) for test context [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@15f519f7, testMethod = testAjoutInscription@InscriptionControllerIntegrationTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@615e83ac]; rollback [true]
     
    MockHttpServletRequest:
          HTTP Method = DELETE
          Request URI = /api/inscription/null
           Parameters = {}
              Headers = {}
                 Body = null
        Session Attrs = {}
     
    Handler:
                 Type = friendsofmine.m2.controllers.InscriptionController
               Method = public void friendsofmine.m2.controllers.InscriptionController.deleteInscriptionById(long)
     
    Async:
        Async started = false
         Async result = null
     
    Resolved Exception:
                 Type = org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
     
    ModelAndView:
            View name = null
                 View = null
                Model = null
     
    FlashMap:
           Attributes = null
     
    MockHttpServletResponse:
               Status = 400
        Error message = null
              Headers = {}
         Content type = null
                 Body = 
        Forwarded URL = null
       Redirected URL = null
              Cookies = []
    2018-11-08 13:28:37.886  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Rolled back transaction for test: [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@15f519f7, testMethod = testAjoutInscription@InscriptionControllerIntegrationTest, testException = org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException, mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]
     
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException
     
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982)
    	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:877)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
    	at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:71)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    	at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:166)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    	at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:133)
    	at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:165)
    	at friendsofmine.m2.InscriptionControllerIntegrationTest.testAjoutInscription(InscriptionControllerIntegrationTest.java:86)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)
    	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    Caused by: java.lang.NullPointerException
    	at friendsofmine.m2.controllers.InscriptionController.createInscription(InscriptionController.java:86)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
    	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
    	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
    	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
    	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
    	... 51 more
     
    2018-11-08 13:28:37.890  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Began transaction (1) for test context [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@4bf8b77, testMethod = testShowInscriptionExistante@InscriptionControllerIntegrationTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@615e83ac]; rollback [true]
    2018-11-08 13:28:37.892  WARN 2421 --- [           main] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'long'; nested exception is java.lang.NumberFormatException: For input string: "null"]
     
    MockHttpServletRequest:
          HTTP Method = DELETE
          Request URI = /api/inscription/null
           Parameters = {}
              Headers = {}
                 Body = null
        Session Attrs = {}
     
    Handler:
                 Type = friendsofmine.m2.controllers.InscriptionController
               Method = public void friendsofmine.m2.controllers.InscriptionController.deleteInscriptionById(long)
     
    Async:
        Async started = false
         Async result = null
     
    Resolved Exception:
                 Type = org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
     
    ModelAndView:
            View name = null
                 View = null
                Model = null
     
    FlashMap:
           Attributes = null
     
    MockHttpServletResponse:
               Status = 400
        Error message = null
              Headers = {}
         Content type = null
                 Body = 
        Forwarded URL = null
       Redirected URL = null
              Cookies = []
     
    MockHttpServletRequest:
          HTTP Method = GET
          Request URI = /api/inscription/null
           Parameters = {}
              Headers = {}
                 Body = null
        Session Attrs = {}
     
    Handler:
                 Type = friendsofmine.m2.controllers.InscriptionController
               Method = public org.springframework.http.ResponseEntity friendsofmine.m2.controllers.InscriptionController.findInscriptionById(long)
     
    Async:
        Async started = false
         Async result = null
     
    Resolved Exception:
                 Type = org.springframework.web.method.annotation.MethodArgumentTypeMismatchException
     
    ModelAndView:
            View name = null
                 View = null
                Model = null
     
    FlashMap:
           Attributes = null
     
    MockHttpServletResponse:
               Status = 400
        Error message = null
              Headers = {}
         Content type = null
                 Body = 
        Forwarded URL = null
       Redirected URL = null
              Cookies = []
    2018-11-08 13:28:37.895  INFO 2421 --- [           main] o.s.t.c.transaction.TransactionContext   : Rolled back transaction for test: [DefaultTestContext@f79e testClass = InscriptionControllerIntegrationTest, testInstance = friendsofmine.m2.InscriptionControllerIntegrationTest@4bf8b77, testMethod = testShowInscriptionExistante@InscriptionControllerIntegrationTest, testException = java.lang.AssertionError: Status expected:<200> but was:<400>, mergedContextConfiguration = [WebMergedContextConfiguration@7ee8290b testClass = InscriptionControllerIntegrationTest, locations = '{}', classes = '{class friendsofmine.m2.FriendsOfMineM2Application}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@1f59a598 key = [org.springframework.boot.test.autoconfigure.web.servlet.MockMvcAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcSecurityAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebClientAutoConfiguration, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcWebDriverAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@fcd6521, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@5579bb86, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@768b970c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@e7e8512, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@44f75083], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true]]
     
    java.lang.AssertionError: Status 
    Expected :200
    Actual   :400
     <Click to see difference>
     
     
    	at org.springframework.test.util.AssertionErrors.fail(AssertionErrors.java:55)
    	at org.springframework.test.util.AssertionErrors.assertEquals(AssertionErrors.java:82)
    	at org.springframework.test.web.servlet.result.StatusResultMatchers.lambda$matcher$9(StatusResultMatchers.java:619)
    	at org.springframework.test.web.servlet.MockMvc$1.andExpect(MockMvc.java:178)
    	at friendsofmine.m2.InscriptionControllerIntegrationTest.testShowInscriptionExistante(InscriptionControllerIntegrationTest.java:53)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73)
    	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
     
    2018-11-08 13:28:37.899  INFO 2421 --- [       Thread-5] o.s.w.c.s.GenericWebApplicationContext   : Closing org.springframework.web.context.support.GenericWebApplicationContext@14dd7b39: startup date [Thu Nov 08 13:28:33 CET 2018]; root of context hierarchy
    2018-11-08 13:28:37.905  INFO 2421 --- [       Thread-5] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
    2018-11-08 13:28:37.905  INFO 2421 --- [       Thread-5] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed drop of schema as part of SessionFactory shut-down'
    2018-11-08 13:28:37.906 DEBUG 2421 --- [       Thread-5] org.hibernate.SQL                        : drop table activite if exists
    2018-11-08 13:28:37.906  WARN 2421 --- [       Thread-5] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 90121, SQLState: 90121
    2018-11-08 13:28:37.906 ERROR 2421 --- [       Thread-5] o.h.engine.jdbc.spi.SqlExceptionHelper   : La base de données est déjà fermée (pour désactiver la fermeture automatique à larrêt de la VM, ajoutez "; DB_CLOSE_ON_EXIT = FALSE" à lURL db)
    Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
    2018-11-08 13:28:37.908  WARN 2421 --- [       Thread-5] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 90121, SQLState: 90121
    2018-11-08 13:28:37.908 ERROR 2421 --- [       Thread-5] o.h.engine.jdbc.spi.SqlExceptionHelper   : La base de données est déjà fermée (pour désactiver la fermeture automatique à larrêt de la VM, ajoutez "; DB_CLOSE_ON_EXIT = FALSE" à lURL db)
    Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
    2018-11-08 13:28:37.908  WARN 2421 --- [       Thread-5] o.s.b.f.support.DisposableBeanAdapter    : Invocation of destroy method failed on bean with name 'entityManagerFactory': org.hibernate.exception.GenericJDBCException: Unable to release JDBC Connection used for DDL execution
    2018-11-08 13:28:37.910  WARN 2421 --- [       Thread-5] o.s.b.f.support.DisposableBeanAdapter    : Invocation of destroy method failed on bean with name 'inMemoryDatabaseShutdownExecutor': org.h2.jdbc.JdbcSQLException: La base de données est déjà fermée (pour désactiver la fermeture automatique à larrêt de la VM, ajoutez "; DB_CLOSE_ON_EXIT = FALSE" à lURL db)
    Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-197]
    2018-11-08 13:28:37.910  INFO 2421 --- [       Thread-5] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
    2018-11-08 13:28:37.912  INFO 2421 --- [       Thread-5] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
     
    Process finished with exit code 255

    Et voilà ma classe InscriptionController

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
     
    package friendsofmine.m2.controllers;
     
    import friendsofmine.m2.domain.Activite;
    import friendsofmine.m2.domain.Inscription;
    import friendsofmine.m2.domain.Utilisateur;
    import friendsofmine.m2.services.ActiviteService;
    import friendsofmine.m2.services.InscriptionService;
    import friendsofmine.m2.services.UtilisateurService;
    import org.springframework.http.HttpStatus;
    import org.springframework.http.ResponseEntity;
    import org.springframework.web.bind.annotation.*;
     
    import java.util.Date;
     
    import static org.springframework.http.HttpStatus.CREATED;
    import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
    import static org.springframework.web.bind.annotation.RequestMethod.POST;
    import static org.springframework.web.bind.annotation.RequestMethod.GET;
     
    @RestController
    public class InscriptionController {
     
        public InscriptionController(){
     
        }
     
        private ActiviteService as;
        private UtilisateurService us;
        private InscriptionService is;
     
        public ActiviteService getActiviteService() {
            return as;
        }
     
        public void setActiviteService(ActiviteService as) {
            this.as = as;
        }
     
        public UtilisateurService getUtilisateurService() {
            return us;
        }
     
        public void setUtilisateurService(UtilisateurService us) {
            this.us = us;
        }
     
        public InscriptionService getInscriptionService() {
            return is;
        }
     
        public void setInscriptionService(InscriptionService is) {
            this.is = is;
        }
     
     
     
     
        public void addInscription(long idUtilisateur, long idActivite) {
            Utilisateur utilisateur = us.findUtilisateurById(idUtilisateur);
            Activite activite = as.findActiviteById(idActivite);
            is.saveInscription(new Inscription(utilisateur,activite,new Date()));
        }
     
     
        public void deleteInscription(long l) {
            is.deleteInscription(l);
        }
     
        @RequestMapping(value="/api/inscription/{id}", method= RequestMethod.GET)
        public ResponseEntity findInscriptionById(@PathVariable long id) {
     
            if (is.findInscriptionById(id) == null)
            {
                return new ResponseEntity<>(HttpStatus.NOT_FOUND);
            }else{
                return new ResponseEntity<>(is.findInscriptionById(id) , HttpStatus.OK);
            }
     
     
        }
     
        @RequestMapping(value="/api/inscription", method= RequestMethod.POST)
        @ResponseStatus(CREATED)
        public Inscription createInscription(@RequestParam("utilisateur_id") long utilisateur_id, @RequestParam("activite_id") long activite_id) {
     
            Utilisateur utilisateur = us.findUtilisateurById(utilisateur_id);
            Activite activite = as.findActiviteById(activite_id);
     
     
            Inscription insc = new Inscription(utilisateur,activite,new Date());
            return is.saveInscription(insc);
        }
     
     
     
        @RequestMapping(value="/api/inscription/{id}", method= RequestMethod.DELETE)
        public void deleteInscriptionById(@PathVariable long id) {
            is.deleteInscription(id);
        }
    }

    InscriptionService

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
     
    package friendsofmine.m2.services;
     
    import friendsofmine.m2.domain.Inscription;
    import friendsofmine.m2.repositories.InscriptionRepository;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.stereotype.Service;
     
    import java.util.Date;
     
    @Service
    public class InscriptionService {
     
        @Autowired
        private InscriptionRepository repoI;
     
        public InscriptionService(){
     
        }
     
     
        public Inscription saveInscription(Inscription ins) throws IllegalArgumentException{
            if(ins==null){
                throw new IllegalArgumentException();
            }else{
                if(ins.getDateInscription()==null){
                    Date temp=new Date();
                    ins.setDateInscription(temp);
                }
                repoI.save(ins);
            }
            return ins;
        }
     
        public Inscription findInscriptionById(long id){
     
            return repoI.findById(id);
     
        }
     
        public long countInscription(){
            return repoI.count();
        }
     
        public void deleteInscription(long id){
     
            repoI.deleteById(id);
        }
     
     
     
    }
    Je peux fournir d'autres classes si nécessaires, mais je pense que ce que j'ai montré là suffit à analyser le problème. N'hésitez pas à me demander de rajouter si vous pensez que le problème est ailleurs; j'avoue être un peu perdu pour le moment.

    Merci

  2. #2
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Bonjour,

    HTTP Method = DELETE
    Request URI = /api/inscription/null
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    @RequestMapping(value="/api/inscription/{id}", method= RequestMethod.DELETE)
        public void deleteInscriptionById(@PathVariable long id) {
    Un long (type primitif) doit avoir une valeur entier (0,1,-1,...), et ne peut pas avoir une valeur null comme pour l'objet Long.
    Ensuite, évite d'utiliser le même URL différencié simplement par la méthode (GET, DELETE, POST) pour différent type d'action pour ne pas les confondre facilement pendant la maintenance.

    A+.

  3. #3
    Membre éprouvé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Août 2011
    Messages
    756
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Août 2011
    Messages : 756
    Par défaut
    Ok pour les URLS je mets ça dans un coin, maintenant c'est un simple TP donc je suis obligé de garder cette structure pour la suite du cours

    Ceci étant dit, pour l'erreur du long, je crois comprendre ce que vous dites, mais je ne vois pas comment régler ce problème pour autant. Changer mes long en Long ne semble pas avoir réglé le problème.

    Merci.

  4. #4
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    retourne null, ce qui fait que l'url serait /api/inscription/null, tu dois passer un entier à la place de ce null.

    A+.

  5. #5
    Membre éprouvé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Août 2011
    Messages
    756
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 31
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Août 2011
    Messages : 756
    Par défaut
    Citation Envoyé par andry.aime Voir le message
    retourne null, ce qui fait que l'url serait /api/inscription/null, tu dois passer un entier à la place de ce null.

    A+.
    Salut,

    je suis d'accord, je dois passer un entier pour que cela fonctionne, mais là il s'agit d'un code de test, il est donc tout à fait normal que le test envoie une valeur null.
    Ce qui n'est pas normal en revanche c'est que cette valeur ne soit pas traité car dans le contrôleur, si l'id envoyé est nul je suis supposé renvoyé un code http précis.

    Or ce n'est pas le cas ici.

    Cela me porte à penser que l'erreur est ailleurs.

    EDIT: En y regardant de plus près je n'ai pas testé le cas de l'id null dans toutes les requêtes, le problème vient peut-être de là. Je vais essayer.

    Merci.

Discussions similaires

  1. Déréférencement d'un pointeur null (dans une classe)
    Par polymorphisme dans le forum Langage
    Réponses: 5
    Dernier message: 13/09/2012, 15h44
  2. Pointeur null dans le Thread AWT-EventQueue-0
    Par le.jitou dans le forum Interfaces Graphiques en Java
    Réponses: 0
    Dernier message: 09/04/2012, 19h28
  3. Pointeur NULL dans conteneur c++
    Par nonoxen dans le forum Langage
    Réponses: 23
    Dernier message: 23/11/2009, 21h14
  4. Réponses: 0
    Dernier message: 07/10/2008, 10h10
  5. passage pointeur NULL dans une fonction
    Par reptils dans le forum C
    Réponses: 4
    Dernier message: 11/05/2006, 23h12

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo