Skip to content

Commit

Permalink
feat : rename file and adds assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli authored Dec 26, 2023
1 parent d6c8457 commit 64692d2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8080]
"forwardPorts": [8080],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",
"postCreateCommand": "java -version"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@
"projectName": "spring-boot-multiple-producers-consumers",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-Application<spring-modulith-outbox-pattern>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.example.outboxpattern.Application",
"projectName": "spring-modulith-outbox-pattern",
"args": "--spring.profiles.active=local",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-TestApplication<spring-modulith-outbox-pattern>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.example.outboxpattern.TestApplication",
"projectName": "spring-modulith-outbox-pattern",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.outboxpattern.shipping;
package com.example.outboxpattern.producer;

import com.example.outboxpattern.order.OrderResponse;
import lombok.RequiredArgsConstructor;
Expand All @@ -11,14 +11,14 @@
@Service
@Transactional
@RequiredArgsConstructor
public class Shipping {
public class Producer {

@ApplicationModuleListener
void on(OrderResponse event) {
ship(event.id());
void onOrderResponseEvent(OrderResponse event) {
publish(event.id());
}

private void ship(Long orderId) {
log.info("Started shipping for order {}", orderId);
private void publish(Long orderId) {
log.info("Started publishing for order {}", orderId);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package com.example.outboxpattern;

import static org.assertj.core.api.Assertions.assertThat;

import com.zaxxer.hikari.HikariDataSource;
import javax.sql.DataSource;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;

@DataJpaTest(
Expand All @@ -11,6 +16,11 @@
})
class SchemaValidationTest {

@Autowired
private DataSource dataSource;

@Test
void validateJpaMappingsWithDbSchema() {}
void validateJpaMappingsWithDbSchema() {
assertThat(dataSource).isInstanceOf(HikariDataSource.class);
}
}

0 comments on commit 64692d2

Please sign in to comment.