Java Portal | Программирование
Присоединяйтесь к нашему каналу и погрузитесь в мир для Java-разработчика Связь: @devmangx РКН: https://clck.ru/3H4WUg
Show more📈 Analytical overview of Telegram channel Java Portal | Программирование
Channel Java Portal | Программирование (@java_iibrary) in the Russian language segment is an active participant. Currently, the community unites 12 130 subscribers, ranking 10 402 in the Technologies & Applications category and 54 525 in the Russia region.
📊 Audience metrics and dynamics
Since its creation on невідомо, the project has demonstrated rapid growth, gathering an audience of 12 130 subscribers.
According to the latest data from 07 June, 2026, the channel demonstrates stable activity. Although there has been a change in the number of participants by -138 over the last 30 days and by 2 over the last 24 hours, overall reach remains high.
- Verification status: Not verified
- Engagement rate (ER): The average audience engagement rate is 11.37%. Within the first 24 hours after publication, content typically collects 6.26% reactions from the total number of subscribers.
- Post reach: On average, each post receives 1 379 views. Within the first day, a publication typically gains 760 views.
- Reactions and interaction: The audience actively supports content: the average number of reactions per post is 4.
- Thematic interests: Content is focused on key topics such as boot, string, void, архитектура, resttemplate.
📝 Description and content policy
The author describes the resource as a platform for expressing subjective opinions:
“Присоединяйтесь к нашему каналу и погрузитесь в мир для Java-разработчика
Связь: @devmangx
РКН: https://clck.ru/3H4WUg”
Thanks to the high frequency of updates (latest data received on 08 June, 2026), the channel maintains relevance and a high level of publication reach. Analytics show that the audience actively interacts with content, making it an important point of influence in the Technologies & Applications category.
@Sql.
@SpringBootTest
@Sql("/test/products.sql")
class ProductServiceTest {
@Autowired
ProductService productService;
@Test
void findProductByName() {
Product product = productService.findByName("product1");
assertThat(product).isNotNull();
}
}
👉 Java Portal@DataJpaTest можно прогонять JPA репозитории изолированно.
@DataJpaTest поднимает только JPA слой без всего приложения, использует in-memory базу H2 и откатывает транзакции после каждого теста.
👉 Java Portal@JsonCreator
Каждый параметр явно биндится.
Определяем конструктор с @JsonCreator:
class User {
public final String username;
public final int age;
@JsonCreator
public User(
@JsonProperty("username") String username,
@JsonProperty("age") int age
) {
this.username = username;
this.age = age;
}
}
👉 Java Portallist.stream()
.filter(x -> x > 10)
.peek(x -> System.out.println("Filter: " + x))
.map(x -> x * 2)
.peek(x -> System.out.println("Map: " + x))
.toList();
👉 Java Portalclass Engine {
void start() {
}
}
и Car наследуется от Engine:
class Car extends Engine {
void drive() {
start();
}
}
Наследование выражает отношение is, но автомобиль на самом деле не является двигателем, он имеет двигатель. Перепишем через делегацию:
class Car {
private Engine engine;
Car(Engine engine) {
this.engine = engine;
}
void drive() {
engine.start();
}
}
Таким образом эти два класса развязаны, и отношение превращается в has.
👉 Java Portallist.stream()
.filter(x -> x > 10)
.peek(x -> System.out.println("Filter: " + x))
.map(x -> x * 2)
.peek(x -> System.out.println("Map: " + x))
.toList();
👉 Java Portal@Service
public class ProductService {
private final RestTemplate restTemplate;
public ProductService(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
public String getProductName(long id) {
Product product = restTemplate.getForObject(
"https://remoteapi.com/products/{id}",
Product.class,
id
);
return product.getName();
}
}
Тест можно реализовать так:
@SpringBootTest
class ProductServiceTest {
@Autowired
private RestTemplate restTemplate;
@Autowired
private ProductService productService;
private MockRestServiceServer mockServer;
@BeforeEach
void setup() {
mockServer = MockRestServiceServer.createServer(restTemplate);
}
@Test
void shouldReturnProductWhenExternalApiCalled() {
// Arrange
mockServer.expect(requestTo("https://remoteapi.com/products/1"))
.andExpect(method(HttpMethod.GET))
.andRespond(withSuccess(
"{\"id\":1,\"name\":\"USB stick\"}",
MediaType.APPLICATION_JSON
));
// Act
ProductDto product = productService.getProduct(1L);
// Assert
assertThat(product.getName()).isEqualTo("USB stick");
mockServer.verify();
}
}
👉 Java PortalИнъекция в поле:
@Component
public class UserController {
@Autowired
private Logger logger;
public void createUser(String username) {
...
}
}
// Сложнее тестировать изолированно.
Инъекция через конструктор:
...
private final Logger logger;
@Autowired
public UserController(Logger logger) {
this.logger = logger;
}
...
// Проще создавать экземпляр для unit-тестов
👉 Java Portal[
{ "id": 1, "name": "John" },
{ "id": 2, "name": "Lia" }
...
]
С пагинацией:
{
"content": [
{ "id": 1, "name": "John" },
{ "id": 2, "name": "Lia" }
...
],
"page": {
"size": 20,
"number": 0,
"totalElements": 50213,
"totalPages": 2511
}
}
Вместо того чтобы напрямую возвращать Page<T>, можно вернуть кастомный paged response DTO, чтобы не светить типы фреймворка в API.
record PagedResponse<T>(
List<T> items,
int page,
int size,
long totalElements,
int totalPages
) {}
И метод контроллера будет выглядеть примерно так:
@GetMapping
public PagedResponse<User> getUsers(Pageable pageable) {
Page<User> page = repository.findAll(pageable);
return new PagedResponse<>(
page.getContent(),
page.getNumber(),
page.getSize(),
page.getTotalElements(),
page.getTotalPages()
);
}
👉 Java Portal
Available now! Telegram Research 2025 — the year's key insights 
