Removed visibility modifier code smells
This commit is contained in:
@@ -22,7 +22,7 @@ import org.mockito.MockitoAnnotations;
|
||||
import de.rwu.easydrop.api.client.AmazonProductDataSource;
|
||||
import de.rwu.easydrop.api.dto.ProductDTO;
|
||||
|
||||
public class AmazonProductDataSourceTest {
|
||||
class AmazonProductDataSourceTest {
|
||||
|
||||
private AmazonProductDataSource demoDataSource;
|
||||
|
||||
@@ -32,7 +32,7 @@ public class AmazonProductDataSourceTest {
|
||||
private static String demoProductId = "whateverId";
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
void setup() {
|
||||
demoDataSource = new AmazonProductDataSource(
|
||||
demoApiUrl,
|
||||
demoApiKey);
|
||||
@@ -40,7 +40,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor() {
|
||||
void testConstructor() {
|
||||
// Assert
|
||||
try {
|
||||
Field baseUrlField = AmazonProductDataSource.class.getDeclaredField("baseUrl");
|
||||
@@ -58,7 +58,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreateApiUrl() throws MalformedURLException {
|
||||
void testCreateApiUrl() throws MalformedURLException {
|
||||
// Test case 1
|
||||
String productId1 = "12345";
|
||||
URL expectedUrl1 = new URL(
|
||||
@@ -76,7 +76,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBuildProductDTO_completeData() {
|
||||
void testBuildProductDTO_completeData() {
|
||||
// Set up the test environment
|
||||
String json = "{\"featuredOffer\": {\"availability\": \"available\"," +
|
||||
"\"price\": {\"value\": {\"amount\": 10.0}}," +
|
||||
@@ -96,7 +96,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBuildProductDTO_incompleteData() {
|
||||
void testBuildProductDTO_incompleteData() {
|
||||
// Set up the test environment
|
||||
String json = "{\"otherOffer\": {\"availability\": \"available\"," +
|
||||
"\"price\": {\"value\": {\"amount\": 10.0}}," +
|
||||
@@ -116,7 +116,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetProductDTOById_successfulRequest() throws IOException {
|
||||
void testGetProductDTOById_successfulRequest() throws IOException {
|
||||
// Set up the test environment
|
||||
String mockResponse = "{\"featuredOffer\": {\"availability\": \"available\"," +
|
||||
"\"price\": {\"value\": {\"amount\": 10.0}}," +
|
||||
@@ -146,7 +146,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetProductDTOById_failedRequest() throws IOException {
|
||||
void testGetProductDTOById_failedRequest() throws IOException {
|
||||
// Set up the test environment
|
||||
|
||||
AmazonProductDataSource dataSource = mock(AmazonProductDataSource.class);
|
||||
@@ -167,7 +167,7 @@ public class AmazonProductDataSourceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetProductDTOById_ioException() throws IOException {
|
||||
void testGetProductDTOById_ioException() throws IOException {
|
||||
// Set up the test environment
|
||||
AmazonProductDataSource dataSource = mock(AmazonProductDataSource.class);
|
||||
URL mockURL = mock(URL.class);
|
||||
|
||||
@@ -11,7 +11,7 @@ import javax.naming.ConfigurationException;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class ConfigImplTest {
|
||||
class ConfigImplTest {
|
||||
private Config config;
|
||||
private final static String TESTDATA_PATH = "testResources/testdata.properties";
|
||||
private final static String TESTDATA_KEY = "API_KEY";
|
||||
|
||||
@@ -10,10 +10,10 @@ import java.lang.reflect.Modifier;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class FormattingUtilTest {
|
||||
class FormattingUtilTest {
|
||||
|
||||
@Test
|
||||
public void testConstructorIsPrivate()
|
||||
void testConstructorIsPrivate()
|
||||
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
|
||||
// Check for private constructor
|
||||
Constructor<FormattingUtil> constructor = FormattingUtil.class.getDeclaredConstructor();
|
||||
@@ -27,7 +27,7 @@ public class FormattingUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatEuro_positiveAmount() {
|
||||
void testFormatEuro_positiveAmount() {
|
||||
double amount = 1234.56;
|
||||
String expectedFormattedAmount = "1.234,56 €";
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FormattingUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatEuro_zeroAmount() {
|
||||
void testFormatEuro_zeroAmount() {
|
||||
double amount = 0.0;
|
||||
String expectedFormattedAmount = "0,00 €";
|
||||
|
||||
@@ -47,7 +47,7 @@ public class FormattingUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormatEuro_negativeAmount() {
|
||||
void testFormatEuro_negativeAmount() {
|
||||
double amount = -789.12;
|
||||
String expectedFormattedAmount = "-789,12 €";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user