Code Cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package dev.rheinsw.shared.transport;
|
||||
package dev.rheinsw.common.dtos;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package dev.rheinsw.shared.rest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
/**
|
||||
* @author Thatsaphorn Atchariyaphap
|
||||
* @since 23.04.25
|
||||
*/
|
||||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
|
||||
@Bean
|
||||
public RestTemplate plainRestTemplate() {
|
||||
return new RestTemplate();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package dev.rheinsw.shared.rest;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class RestTemplateConfigTest {
|
||||
|
||||
private final RestTemplateConfig restTemplateConfig = new RestTemplateConfig();
|
||||
|
||||
@Test
|
||||
void plainRestTemplate_shouldReturnNonNullRestTemplate() {
|
||||
// Act
|
||||
RestTemplate restTemplate = restTemplateConfig.plainRestTemplate();
|
||||
|
||||
// Assert
|
||||
assertNotNull(restTemplate, "RestTemplate should not be null");
|
||||
}
|
||||
|
||||
@Test
|
||||
void plainRestTemplate_shouldCreateNewInstanceEachTime() {
|
||||
// Act
|
||||
RestTemplate restTemplate1 = restTemplateConfig.plainRestTemplate();
|
||||
RestTemplate restTemplate2 = restTemplateConfig.plainRestTemplate();
|
||||
|
||||
// Assert
|
||||
assertNotSame(restTemplate1, restTemplate2, "Each call should create a new RestTemplate instance");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user