diff --git a/back/src/main/java/com/tdevilleduc/urthehero/back/controller/EnemyController.kt b/back/src/main/java/com/tdevilleduc/urthehero/back/controller/EnemyController.kt index 0b3ddd5..60dc69b 100644 --- a/back/src/main/java/com/tdevilleduc/urthehero/back/controller/EnemyController.kt +++ b/back/src/main/java/com/tdevilleduc/urthehero/back/controller/EnemyController.kt @@ -5,7 +5,6 @@ import com.tdevilleduc.urthehero.back.exceptions.EnemyInternalErrorException import com.tdevilleduc.urthehero.back.model.Enemy import com.tdevilleduc.urthehero.back.model.EnemyDTO import com.tdevilleduc.urthehero.back.service.IEnemyService -import io.swagger.v3.oas.annotations.Operation import io.swagger.v3.oas.annotations.security.SecurityRequirement import io.swagger.v3.oas.annotations.tags.Tag import org.slf4j.helpers.MessageFormatter @@ -24,20 +23,17 @@ internal class EnemyController(private val enemyService: IEnemyService) { @GetMapping(value = ["/{enemyId}"], produces = [MediaType.APPLICATION_JSON_VALUE]) @ResponseStatus(HttpStatus.OK) -// @Operation(summary = "\${swagger.controller.enemy.get-by-id.value}", description = "\${swagger.controller.enemy.get-by-id.notes}") fun getById(@PathVariable enemyId: Int): Callable> = Callable { ResponseEntity.ok(enemyService.findById(enemyId)) } @GetMapping(value = ["/level/{enemyLevel}"], produces = [MediaType.APPLICATION_JSON_VALUE]) @ResponseStatus(HttpStatus.OK) -// @Operation(summary = "\${swagger.controller.enemy.get-by-level.value}", description = "\${swagger.controller.enemy.get-by-level.notes}") fun getByLevel(@PathVariable enemyLevel: Int): Callable> = Callable { ResponseEntity.ok(enemyService.findByLevel(enemyLevel)) } @PutMapping -// @Operation(summary = "\${swagger.controller.enemy.create.value}", description = "\${swagger.controller.enemy.create.notes}") fun create(@RequestBody enemyDto: EnemyDTO): Callable> = Callable { if (enemyService.exists(enemyDto.id)) { throw EnemyInternalErrorException(MessageFormatter.format(ApplicationConstants.ERROR_MESSAGE_ENEMY_ID_ALREADY_EXISTS, enemyDto.id).message) @@ -46,7 +42,6 @@ internal class EnemyController(private val enemyService: IEnemyService) { } @PostMapping -// @Operation(summary = "\${swagger.controller.enemy.update.value}", description = "\${swagger.controller.enemy.update.notes}") fun update(@RequestBody enemyDto: EnemyDTO): Callable> = Callable { Assert.notNull(enemyDto.id) { throw EnemyInternalErrorException(ApplicationConstants.ERROR_MESSAGE_ENEMY_ID_CANNOT_BE_NULL) } if (enemyService.notExists(enemyDto.id)) { @@ -56,7 +51,6 @@ internal class EnemyController(private val enemyService: IEnemyService) { } @DeleteMapping(value = ["/{enemyId}"]) -// @Operation(summary = "\${swagger.controller.enemy.delete.value}", description = "\${swagger.controller.enemy.delete.notes}") fun delete(@PathVariable enemyId: Int) = Callable { enemyService.delete(enemyId) } diff --git a/back/src/test/java/com/tdevilleduc/urthehero/back/controller/ProgressionControllerTest.kt b/back/src/test/java/com/tdevilleduc/urthehero/back/controller/ProgressionControllerTest.kt index 2e798d4..a2d3bc1 100644 --- a/back/src/test/java/com/tdevilleduc/urthehero/back/controller/ProgressionControllerTest.kt +++ b/back/src/test/java/com/tdevilleduc/urthehero/back/controller/ProgressionControllerTest.kt @@ -50,9 +50,6 @@ class ProgressionControllerTest : AbstractITTest() { .andExpect(MockMvcResultMatchers.jsonPath("$[0].userId", Matchers.`is`(userId))) .andExpect(MockMvcResultMatchers.jsonPath("$[0].storyId", Matchers.`is`(2))) .andExpect(MockMvcResultMatchers.jsonPath("$[0].actualPageId", Matchers.`is`(3))) -// .andExpect(MockMvcResultMatchers.jsonPath("$[1].userId", Matchers.`is`(userId))) -// .andExpect(MockMvcResultMatchers.jsonPath("$[1].storyId", Matchers.`is`(1))) -// .andExpect(MockMvcResultMatchers.jsonPath("$[1].actualPageId", Matchers.`is`(2))) } @Test diff --git a/back/src/test/java/com/tdevilleduc/urthehero/back/model/PersonTest.kt b/back/src/test/java/com/tdevilleduc/urthehero/back/model/PersonTest.kt deleted file mode 100644 index b9b3376..0000000 --- a/back/src/test/java/com/tdevilleduc/urthehero/back/model/PersonTest.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.tdevilleduc.urthehero.back.model - -import org.junit.jupiter.api.Assertions -import org.junit.jupiter.api.Test -import org.apache.commons.lang3.RandomStringUtils - -internal class PersonTest { -// @Test -// fun test_Constructor() { -// val personId = 31 -// val personLogin = RandomStringUtils.random(20) -// val person = User(personId, personLogin) -// Assertions.assertEquals(person.username, personLogin) -// val secondPerson = User(personId) -// secondPerson.username = personLogin -// Assertions.assertEquals(secondPerson.toString(), person.toString()) -// Assertions.assertEquals(secondPerson, person) -// } -} \ No newline at end of file diff --git a/back/src/test/java/com/tdevilleduc/urthehero/back/service/PageServiceTest.kt b/back/src/test/java/com/tdevilleduc/urthehero/back/service/PageServiceTest.kt index f0ded00..ea288e8 100644 --- a/back/src/test/java/com/tdevilleduc/urthehero/back/service/PageServiceTest.kt +++ b/back/src/test/java/com/tdevilleduc/urthehero/back/service/PageServiceTest.kt @@ -54,31 +54,6 @@ internal class PageServiceTest { Assertions.assertEquals(expectedPage.id, page.id) Assertions.assertEquals(expectedPage.image, page.image) Assertions.assertEquals(expectedPage.text, page.text) -// val nextPageList = page.nextPageList -// Assertions.assertNotNull(nextPageList) -// Assertions.assertFalse(nextPageList.isEmpty()) -// Assertions.assertEquals(3, nextPageList.size) -// val nextPage1 = nextPageList[0] -// Assertions.assertNotNull(nextPage1) -// Assertions.assertEquals(1, nextPage1.id) -// Assertions.assertEquals(2, nextPage1.destinationPageId) -// Assertions.assertEquals(1, nextPage1.pageId) -// Assertions.assertEquals("gauche", nextPage1.text) -// Assertions.assertEquals(Position.LEFT, nextPage1.position) -// val nextPage2 = nextPageList[1] -// Assertions.assertNotNull(nextPage2) -// Assertions.assertEquals(2, nextPage2.id) -// Assertions.assertEquals(3, nextPage2.destinationPageId) -// Assertions.assertEquals(1, nextPage2.pageId) -// Assertions.assertEquals("droite", nextPage2.text) -// Assertions.assertEquals(Position.RIGHT, nextPage2.position) -// val nextPage3 = nextPageList[2] -// Assertions.assertNotNull(nextPage3) -// Assertions.assertEquals(3, nextPage3.id) -// Assertions.assertEquals(8, nextPage3.destinationPageId) -// Assertions.assertEquals(1, nextPage3.pageId) -// Assertions.assertEquals("centre", nextPage3.text) -// Assertions.assertEquals(Position.CENTER, nextPage3.position) } @Test