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
package com.kaffeinelabs; | |
import com.kaffeinelabs.test.junit.extension.LoggerExtension; | |
import org.junit.jupiter.api.Test; | |
class FooTest { | |
@RegisterExtension | |
LoggerExtension loggerExtension = LoggerExtension.forLogger(Foo.class); | |
@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
package pl.zalas.eventbus | |
interface EventBus<in E> { | |
fun publish(event: E) | |
} |
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
package pl.zalas.acme.config | |
import com.fasterxml.jackson.databind.Module | |
import org.springframework.context.annotation.Bean | |
import org.springframework.context.annotation.Configuration | |
import pl.zalas.jackson.module.subtype.SubTypeModule | |
@Configuration | |
class JacksonConfig { | |
@Bean |
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
tasks.register("bootRunDev") { | |
group = "application" | |
description = "Runs this project as a Spring Boot application with the dev profile" | |
doFirst { | |
tasks.bootRun.configure { | |
systemProperty("spring.profiles.active", "dev") | |
} | |
} | |
finalizedBy("bootRun") | |
} |
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
package acme.aws; | |
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; | |
import com.amazonaws.services.rds.auth.GetIamAuthTokenRequest; | |
import com.amazonaws.services.rds.auth.RdsIamAuthTokenGenerator; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | |
import org.springframework.stereotype.Component; | |
@Component |
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
package acme.test; | |
import org.springframework.test.context.ActiveProfilesResolver; | |
public class EnvironmentActiveProfileResolver implements ActiveProfilesResolver { | |
@Override | |
public String[] resolve(Class<?> aClass) { | |
return new String[]{System.getenv("BUILD_ID") == null ? "test" : "test,ci"}; | |
} | |
} |
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
package acme.testcontainers; | |
import org.junit.jupiter.api.extension.BeforeAllCallback; | |
import org.junit.jupiter.api.extension.ExtensionContext; | |
import org.testcontainers.containers.PostgreSQLContainer; | |
import org.testcontainers.junit.jupiter.Testcontainers; | |
@Testcontainers | |
public class DatabaseContainerExtension implements BeforeAllCallback { | |
private final PostgreSQLContainer postgreSQLContainer = SharedPostgreSQLContainer.getInstance(); |
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
<?php declare(strict_types=1); | |
use Behat\Mink\Element\NodeElement; | |
use Behat\Mink\Session; | |
use Zalas\PageObject\Annotation\FindBy; | |
use Zalas\PageObject\Annotation\MinkSession; | |
class SearchPage | |
{ | |
/** |
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
<?php declare(strict_types=1); | |
namespace App\Tests\Doubles; | |
use PHPUnit\Framework\TestCase; | |
class Item | |
{ | |
} |
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
<?php | |
declare(strict_types=1); | |
namespace Zalas\Injector\Tests\Service; | |
use PHPUnit\Framework\TestCase; | |
use Prophecy\Prophecy\ObjectProphecy; | |
use Psr\Container\ContainerInterface; | |
use Psr\Container\NotFoundExceptionInterface; | |
use Zalas\Injector\PHPUnit\TestCase\ServiceContainerTestCase; |