This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
public static class AuditLogMicroservicePortConfiguration { | |
@Bean | |
public WireMockConfigurationCustomizer wireMockConfigurationCustomizer(@Value("${auditlog.microservice.port}") | |
int port) { | |
return config -> config.port(port); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(SpringRunner.class) | |
@SpringBootTest(classes = AuditLogMicroservicePortConfiguration.class) | |
@Transactional | |
@AutoConfigureWireMock | |
public class UserServiceTest { | |
@Autowired | |
private UserService userService; | |
@Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@RequiredArgsConstructor | |
public class UserService { | |
private final AuditLogService auditLogService; | |
@Transactional | |
public void createUser(final String email) { | |
// Persist to DB or other business logic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
public class AuditLogService { | |
public void logUserCreated() { | |
// Perform the HTTP call to "/logUserCreation" endpoint | |
// exposed by Audit Log microservice | |
} | |
} |