Skip to content

Commit

Permalink
fix checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
silchenko-arsen committed Oct 20, 2023
1 parent 42be6d6 commit 38cb74c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 20 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<linkXRef>false</linkXRef>
<sourceDirectories>src</sourceDirectories>
</configuration>
</plugin>
</plugins>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/mate/academy/rickandmorty/Application.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package mate.academy.rickandmorty;

import java.util.List;
import mate.academy.rickandmorty.dto.CharacterResponseDto;
import mate.academy.rickandmorty.service.CharacterService;
import mate.academy.rickandmorty.service.RickAndMortyClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;

@SpringBootApplication
public class Application {
private static CharacterService characterService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import mate.academy.rickandmorty.dto.CharacterDto;
import mate.academy.rickandmorty.service.CharacterService;
Expand All @@ -10,8 +11,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "Character management", description = "Endpoints for getting characters from db")
@RequiredArgsConstructor
@RestController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package mate.academy.rickandmorty.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import java.util.List;
import lombok.Data;

@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class ListCharacterDto {
private List<CharacterResponseDto> results;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package mate.academy.rickandmorty.repository;

import java.util.List;
import mate.academy.rickandmorty.model.Character;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface CharacterRepository extends JpaRepository<Character, Long> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package mate.academy.rickandmorty.service;

import java.util.List;
import mate.academy.rickandmorty.dto.CharacterDto;
import mate.academy.rickandmorty.dto.CharacterResponseDto;

import java.util.List;

public interface CharacterService {
CharacterDto getRandomCharacter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.util.List;

import lombok.RequiredArgsConstructor;
import mate.academy.rickandmorty.dto.CharacterResponseDto;
import mate.academy.rickandmorty.dto.ListCharacterDto;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package mate.academy.rickandmorty.service.impl;

import java.util.List;
import java.util.Random;
import lombok.RequiredArgsConstructor;
import mate.academy.rickandmorty.dto.CharacterDto;
import mate.academy.rickandmorty.dto.CharacterResponseDto;
Expand All @@ -9,16 +11,14 @@
import mate.academy.rickandmorty.service.CharacterService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Random;

@RequiredArgsConstructor
@Service
public class CharacterServiceImpl implements CharacterService {
private static int listSize;
private static final Random RANDOM = new Random();
private final CharacterRepository characterRepository;
private final CharacterMapper mapper;

@Override
public CharacterDto getRandomCharacter() {
int id = RANDOM.nextInt(listSize) + 1;
Expand Down
8 changes: 3 additions & 5 deletions src/test/java/mate/academy/rickandmorty/ApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

@SpringBootTest
class ApplicationTests {

@Test
void contextLoads() {
}

@Test
void contextLoads() {
}
}

0 comments on commit 38cb74c

Please sign in to comment.