Skip to content

Commit

Permalink
Removed AvoidStarImport Rule
Browse files Browse the repository at this point in the history
Added JavaDocType Rule
  • Loading branch information
muditporwal committed Mar 21, 2017
1 parent 175e9f5 commit 09585c3
Show file tree
Hide file tree
Showing 105 changed files with 575 additions and 282 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import org.junit.Before;
import org.junit.Test;

/**
* Test for abstract factory
*/
public class AbstractFactoryTest {

private App app = new App();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* Spring Boot EntryPoint Class
*/
@SpringBootApplication
public class App {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
*/
package com.iluwatar.aggregator.microservices;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

/**
* Test Aggregation of domain objects
*/
public class AggregatorTest {

@InjectMocks
Expand Down Expand Up @@ -64,4 +67,4 @@ public void testGetProduct() {
assertEquals(inventories, testProduct.getProductInventories());
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
* Controller providing endpoints to retrieve information about products
*/
@RestController
public class InformationController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.junit.Assert;
import org.junit.Test;

/**
* Test for Information Rest Controller
*/
public class InformationControllerTest {

@Test
Expand All @@ -36,4 +39,4 @@ public void shouldGetProductTitle() {
Assert.assertEquals("The Product Title.", title);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
* Controller providing endpoints to retrieve product inventories
*/
@RestController
public class InventoryController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
import org.junit.Assert;
import org.junit.Test;

/**
* Test Inventory Rest Controller
*/
public class InventoryControllerTest {

@Test
public void testGetProductInventories() throws Exception {
InventoryController inventoryController = new InventoryController();
Expand All @@ -35,4 +37,4 @@ public void testGetProductInventories() throws Exception {

Assert.assertEquals(5, numberOfInventories);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* An adapter to communicate with the Image microservice
*/
@Component
public class ImageClientImpl implements ImageClient{
public class ImageClientImpl implements ImageClient {
/**
* Makes a simple HTTP Get request to the Image microservice
* @return The path to the image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* An adapter to communicate with the Price microservice
*/
@Component
public class PriceClientImpl implements PriceClient{
public class PriceClientImpl implements PriceClient {
/**
* Makes a simple HTTP Get request to the Price microservice
* @return The price of the product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@
*/
package com.iluwatar.api.gateway;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;

/**
* Test API Gateway Pattern
*/
public class ApiGatewayTest {

@InjectMocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.junit.Assert;
import org.junit.Test;

/**
* Test for Image Rest Controller
*/
public class ImageControllerTest {
@Test
public void testGetImagePath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
import org.junit.Assert;
import org.junit.Test;


/**
* Test for Price Rest Controller
*/
public class PriceControllerTest {
@Test
public void testgetPrice() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.util.concurrent.ExecutionException;

/**
*
* AsyncResult interface
* @param <T> parameter returned when getValue is invoked
*/
public interface AsyncResult<T> {

Expand Down
15 changes: 9 additions & 6 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
Source = https://github.com/checkstyle/checkstyle/tree/master/src/main/resources
Checkstyle configurartion that checks the Google coding conventions from:
- Google Java Style
https://google-styleguide.googlecode.com/svn-history/r130/trunk/javaguide.html
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
Expand All @@ -44,12 +44,12 @@
To completely disable a check, just comment it out or delete it from the file.
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
-->

<module name="Checker">
<property name="charset" value="UTF-8"/>

<property name="fileExtensions" value="java, xml, properties"/>

<property name="severity" value="error"/>
Expand Down Expand Up @@ -77,7 +77,6 @@
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
<module name="AvoidStarImport"/>
<module name="OneTopLevelClass"/>
<module name="NoLineWrap"/>
<module name="EmptyBlock">
Expand Down Expand Up @@ -120,7 +119,7 @@
<property name="tokens" value="COMMA"/>
<property name="option" value="EOL"/>
</module>

<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName"/>
Expand Down Expand Up @@ -185,6 +184,10 @@
<property name="allowedAnnotations" value="Override, Test, Before, After, Parameters, Given, When, BeforeClass, AfterClass, Parameterized"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
<module name="JavadocType">
<property name="scope" value="public"/>
<property name="allowUnknownTags" value="true"/>
</module>
<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
Expand Down
9 changes: 6 additions & 3 deletions dao/src/main/java/com/iluwatar/dao/CustomerSchemaSql.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@
*/
package com.iluwatar.dao;

/**
* Customer Schema SQL Class
*/
public final class CustomerSchemaSql {

private CustomerSchemaSql() {}

public static final String CREATE_SCHEMA_SQL = "CREATE TABLE CUSTOMERS (ID NUMBER, FNAME VARCHAR(100), "
public static final String CREATE_SCHEMA_SQL = "CREATE TABLE CUSTOMERS (ID NUMBER, FNAME VARCHAR(100), "
+ "LNAME VARCHAR(100))";

public static final String DELETE_SCHEMA_SQL = "DROP TABLE CUSTOMERS";

}
3 changes: 3 additions & 0 deletions dao/src/test/java/com/iluwatar/dao/CustomerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
import org.junit.Before;
import org.junit.Test;

/**
* Tests {@link Customer}.
*/
public class CustomerTest {

private Customer customer;
Expand Down
23 changes: 13 additions & 10 deletions data-mapper/src/main/java/com/iluwatar/datamapper/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

import java.io.Serializable;

/**
* Class defining Student
*/
public final class Student implements Serializable {

private static final long serialVersionUID = 1L;
Expand All @@ -32,7 +35,7 @@ public final class Student implements Serializable {

/**
* Use this constructor to create a Student with all details
*
*
* @param studentId as unique student id
* @param name as student name
* @param grade as respective grade of student
Expand All @@ -46,55 +49,55 @@ public Student(final int studentId, final String name, final char grade) {
}

/**
*
*
* @return the student id
*/
public int getStudentId() {
return studentId;
}

/**
*
*
* @param studentId as unique student id
*/
public void setStudentId(final int studentId) {
this.studentId = studentId;
}

/**
*
*
* @return name of student
*/
public String getName() {
return name;
}

/**
*
*
* @param name as 'name' of student
*/
public void setName(final String name) {
this.name = name;
}

/**
*
*
* @return grade of student
*/
public char getGrade() {
return grade;
}

/**
*
*
* @param grade as 'grade of student'
*/
public void setGrade(final char grade) {
this.grade = grade;
}

/**
*
*
*/
@Override
public boolean equals(final Object inputObject) {
Expand All @@ -120,7 +123,7 @@ public boolean equals(final Object inputObject) {
}

/**
*
*
*/
@Override
public int hashCode() {
Expand All @@ -130,7 +133,7 @@ public int hashCode() {
}

/**
*
*
*/
@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

import java.util.Optional;

/**
* Interface lists out the possible behaviour for all possible student mappers
*/
public interface StudentDataMapper {

Optional<Student> find(int studentId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import java.util.List;
import java.util.Optional;

/**
* Implementation of Actions on Students Data
*/
public final class StudentDataMapperImpl implements StudentDataMapper {

/* Note: Normally this would be in the form of an actual database */
Expand Down
Loading

0 comments on commit 09585c3

Please sign in to comment.