{"id":3631,"date":"2022-07-26T11:02:35","date_gmt":"2022-07-26T11:02:35","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/test-containers-how-to-make-tests-easier\/"},"modified":"2026-03-11T06:00:15","modified_gmt":"2026-03-11T06:00:15","slug":"testovaci-kontejnery-jak-usnadnit-testovani","status":"publish","type":"post","link":"https:\/\/thecodest.co\/cs\/blog\/test-containers-how-to-make-tests-easier\/","title":{"rendered":"Testovac\u00ed kontejnery - jak si usnadnit testov\u00e1n\u00ed?"},"content":{"rendered":"<p>Modern\u00ed v\u00fdvoj aplikac\u00ed je zalo\u017een na jednom jednoduch\u00e9m pravidle:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><b>Pou\u017eijte slo\u017een\u00ed<\/b><\/p>\n<\/blockquote>\n\n\n\n<p>T\u0159\u00eddy, funkce a slu\u017eby skl\u00e1d\u00e1me do v\u011bt\u0161\u00edch celk\u016f softwaru. Tento posledn\u00ed prvek je z\u00e1kladem <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/microservices\/\">mikroslu\u017eby<\/a> a <a href=\"https:\/\/thecodest.co\/cs\/blog\/the-power-of-hexagonal-architecture\/\">\u0161esti\u00faheln\u00edkov\u00e1 architektura<\/a>. R\u00e1di bychom vyu\u017eili st\u00e1vaj\u00edc\u00ed \u0159e\u0161en\u00ed, integrovali je s na\u0161\u00edm softwarem a p\u0159e\u0161li rovnou na trh. <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/what-is-the-size-of-your-potential-reachable-market\/\">trh<\/a>.<\/p>\n\n\n\n<p>Chcete zpracov\u00e1vat registraci \u00fa\u010dtu a ukl\u00e1dat u\u017eivatele <a href=\"https:\/\/thecodest.co\/cs\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a>? M\u016f\u017eete si vybrat jednu ze slu\u017eeb OAuth. Mo\u017en\u00e1 va\u0161e aplikace nab\u00edz\u00ed n\u011bjak\u00fd druh p\u0159edplatn\u00e9ho nebo platby? Existuje mnoho slu\u017eeb, kter\u00e9 v\u00e1m s t\u00edm mohou pomoci. Pot\u0159ebujete na sv\u00fdch webov\u00fdch str\u00e1nk\u00e1ch n\u011bjakou analytiku, ale nerozum\u00edte tomu. <a href=\"https:\/\/thecodest.co\/cs\/blog\/cyber-security-dilemmas-data-leaks\/\">GDPR<\/a>? Nev\u00e1hejte a vyberte si jedno z hotov\u00fdch \u0159e\u0161en\u00ed.<\/p>\n\n\n\n<p>Z n\u011b\u010deho, co z obchodn\u00edho hlediska tak usnad\u0148uje v\u00fdvoj, v\u00e1s m\u016f\u017ee bolet hlava - ve chv\u00edli, kdy pot\u0159ebujete napsat jednoduch\u00fd test.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fantastick\u00e1 zv\u00ed\u0159ata: Fronty, datab\u00e1ze a jejich testov\u00e1n\u00ed<\/h2>\n\n\n\n<p>Testov\u00e1n\u00ed jednotek je pom\u011brn\u011b jednoduch\u00e9. Pokud se budete \u0159\u00eddit pouze t\u011bmito pravidly, pak va\u0161e testovac\u00ed prost\u0159ed\u00ed a <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/what-is-code-refactoring\/\">k\u00f3d<\/a> jsou zdrav\u00e9. Jak\u00e1 jsou to pravidla?<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><b>Snadn\u00e9 psan\u00ed<\/b> - jednotkov\u00fd test by m\u011bl b\u00fdt snadn\u00fd na psan\u00ed, proto\u017ee jich p\u00ed\u0161ete hodn\u011b. M\u00e9n\u011b \u00fasil\u00ed znamen\u00e1, \u017ee se nap\u00ed\u0161e v\u00edce test\u016f.<\/li>\n\n\n\n<li><b>\u010citeln\u00fd<\/b> - testovac\u00ed k\u00f3d by m\u011bl b\u00fdt snadno \u010diteln\u00fd. Test je p\u0159\u00edb\u011bh. Popisuje chov\u00e1n\u00ed softwaru a mohl by slou\u017eit jako dokumenta\u010dn\u00ed zkratka. Dobr\u00fd jednotkov\u00fd test pom\u00e1h\u00e1 opravovat chyby bez nutnosti lad\u011bn\u00ed k\u00f3du.<\/li>\n\n\n\n<li><b>Spolehliv\u00e9<\/b> - test by m\u011bl selhat pouze v p\u0159\u00edpad\u011b, \u017ee se v testovan\u00e9m syst\u00e9mu vyskytuje chyba. Je to z\u0159ejm\u00e9? Ne v\u017edy. N\u011bkdy testy projdou, pokud je spust\u00edte jeden po druh\u00e9m, ale sel\u017eou, pokud je spust\u00edte jako sadu. Na va\u0161em po\u010d\u00edta\u010di projdou, ale na CI sel\u017eou (<a href=\"https:\/\/blog.codinghorror.com\/the-works-on-my-machine-certification-program\/\">Funguje na m\u00e9m po\u010d\u00edta\u010di<\/a>). Dobr\u00fd jednotkov\u00fd test m\u00e1 pouze jeden d\u016fvod selh\u00e1n\u00ed.<\/li>\n\n\n\n<li><b>Rychle<\/b> - testy by m\u011bly b\u00fdt rychl\u00e9. P\u0159\u00edprava na spu\u0161t\u011bn\u00ed, spu\u0161t\u011bn\u00ed a samotn\u00e9 proveden\u00ed testu by m\u011blo b\u00fdt velmi rychl\u00e9. Jinak je sice nap\u00ed\u0161ete, ale nespust\u00edte. Pomal\u00e9 testy znamenaj\u00ed ztracen\u00e9 soust\u0159ed\u011bn\u00ed. \u010cek\u00e1te a d\u00edv\u00e1te se na ukazatel pr\u016fb\u011bhu.<\/li>\n\n\n\n<li><b>Nez\u00e1visl\u00e9<\/b> - kone\u010dn\u011b, test by m\u011bl b\u00fdt nez\u00e1visl\u00fd. Toto pravidlo vych\u00e1z\u00ed z p\u0159edchoz\u00edch. Pouze skute\u010dn\u011b nez\u00e1visl\u00e9 testy se mohou st\u00e1t jednotkou. Vz\u00e1jemn\u011b se neru\u0161\u00ed, mohou b\u00fdt spu\u0161t\u011bny v libovoln\u00e9m po\u0159ad\u00ed a jejich p\u0159\u00edpadn\u00e9 selh\u00e1n\u00ed nez\u00e1vis\u00ed na v\u00fdsledc\u00edch jin\u00fdch test\u016f. Nez\u00e1vislost tak\u00e9 znamen\u00e1, \u017ee nejsou z\u00e1visl\u00e9 na \u017e\u00e1dn\u00fdch extern\u00edch zdroj\u00edch, jako jsou datab\u00e1ze, slu\u017eby p\u0159enosu zpr\u00e1v nebo souborov\u00fd syst\u00e9m. Pokud pot\u0159ebujete komunikovat s extern\u00edmi zdroji, m\u016f\u017eete pou\u017e\u00edt mocky, stuby nebo atrapy.<\/li>\n<\/ul>\n\n\n\n<p>V\u0161e se zkomplikuje, kdy\u017e chceme napsat integra\u010dn\u00ed testy. Nen\u00ed to \u0161patn\u00e9, pokud bychom cht\u011bli testovat n\u011bkolik slu\u017eeb dohromady. Kdy\u017e ale pot\u0159ebujeme testovat slu\u017eby, kter\u00e9 vyu\u017e\u00edvaj\u00ed extern\u00ed zdroje, jako jsou datab\u00e1ze nebo slu\u017eby pro zas\u00edl\u00e1n\u00ed zpr\u00e1v, koledujeme si o probl\u00e9my.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pro spu\u0161t\u011bn\u00ed testu je t\u0159eba nainstalovat...<\/h3>\n\n\n\n<p>Kdy\u017e jsme p\u0159ed mnoha lety cht\u011bli prov\u00e9st integra\u010dn\u00ed testy a pou\u017e\u00edt nap\u0159. datab\u00e1ze, m\u011bli jsme dv\u011b mo\u017enosti:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Datab\u00e1zi m\u016f\u017eeme nainstalovat lok\u00e1ln\u011b. Nastav\u00edme sch\u00e9ma a p\u0159ipoj\u00edme se z na\u0161eho testu;<\/li>\n\n\n\n<li>M\u016f\u017eeme se p\u0159ipojit k existuj\u00edc\u00ed instanci \"n\u011bkde ve vesm\u00edru\".<\/li>\n<\/ol>\n\n\n\n<p>Ob\u011b m\u011bly klady i z\u00e1pory. Ob\u011b v\u0161ak p\u0159in\u00e1\u0161ej\u00ed dal\u0161\u00ed \u00farovn\u011b slo\u017eitosti. N\u011bkdy to byla technick\u00e1 slo\u017eitost vypl\u00fdvaj\u00edc\u00ed z vlastnost\u00ed ur\u010dit\u00fdch n\u00e1stroj\u016f, nap\u0159. instalace a spr\u00e1va DB Oracle na lok\u00e1ln\u00edm hostiteli. N\u011bkdy \u0161lo o nep\u0159\u00edjemnosti v procesu, nap\u0159. je t\u0159eba se dohodnout s testovac\u00edm <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/how-to-lead-software-development-team\/\">t\u00fdm<\/a> o pou\u017eit\u00ed JMS... poka\u017ed\u00e9, kdy\u017e chcete spustit testy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Kontejnery na pomoc<\/h3>\n\n\n\n<p>V posledn\u00edch deseti letech se v oboru prosadila my\u0161lenka kontejnerizace. Proto je p\u0159irozen\u00fdm rozhodnut\u00edm zvolit kontejnery jako \u0159e\u0161en\u00ed na\u0161eho probl\u00e9mu s integra\u010dn\u00edmi testy. Jedn\u00e1 se o jednoduch\u00e9 a \u010dist\u00e9 \u0159e\u0161en\u00ed. Sta\u010d\u00ed spustit sestaven\u00ed procesu a v\u0161e funguje! Nechce se v\u00e1m tomu v\u011b\u0159it? Pod\u00edvejte se na tuto jednoduchou konfiguraci sestaven\u00ed maven:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml\">com.dkanejs.maven.plugins\n     docker-compose-maven-plugin\n     4.0.0\n     \n       \n         up\n         test-compile\n         \n           up\n         \n         \n           ${<a href=\"https:\/\/thecodest.co\/cs\/dictionary\/why-do-projects-fail\/\">projekt<\/a>.basedir}\/docker-compose.yml\n           true\n         \n       \n       \n         down\n         post-integration-test\n         \n           down\n         \n         \n           ${project.basedir}\/docker-compose.yml\n           true<\/code><\/pre>\n\n\n\n<p>A <code>docker-compose.yml<\/code> soubor vypad\u00e1 tak\u00e9 p\u011bkn\u011b!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">verze: \"3.5\"\n\nslu\u017eby:\n\n Postgres:\n   N\u00e1zev_kontejneru: reactivedb\n   image: postgres:13.2\n   restart: always\n   prost\u0159ed\u00ed:\n     - POSTGRES_USER=admin\n     - POSTGRES_PASSWORD=password\n     - POSTGRES_DB=cities\n   ports:\n     - \"5432:5432\"\n   svazky:\n     - postgres_data:\/data\/db\n\n pgadmin:\n   kontejner_n\u00e1zev: pgadmin4\n   image: dpage\/pgadmin4\n   restart: v\u017edy\n   prost\u0159ed\u00ed:\n     PGADMIN_DEFAULT_EMAIL: admin@admin.com\n     PGADMIN_DEFAULT_PASSWORD: password\n   porty:\n     - \"15050:80\"\n   svazky:\n     - pgadmin_data:\/data\/pgadmin\n\nsvazky:\n postgres_data:\n pgadmin_data:<\/code><\/pre>\n\n\n\n<p>Dok\u00e1\u017eete si ale v\u0161imnout, v \u010dem je probl\u00e9m?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">N\u00e1kladn\u00ed lo\u010f, kter\u00e1 v\u0161e blokuje<\/h3>\n\n\n\n<p>V\u00fd\u0161e uveden\u00fd p\u0159\u00edklad je velmi jednoduch\u00fd. Sta\u010d\u00ed jedna datab\u00e1ze Postgres, pgAdmin a to je v\u0161e. Kdy\u017e spust\u00edte<\/p>\n\n\n\n<p><code>bash<br>\n$ mvn clean verify<br>\n<\/code><br>pak z\u00e1suvn\u00fd modul maven spust\u00ed kontejnery a po testech je vypne. Probl\u00e9my za\u010dnou, kdy\u017e se projekt rozroste a n\u00e1\u0161 soubor compose se rozroste tak\u00e9. Poka\u017ed\u00e9 bude t\u0159eba spustit v\u0161echny kontejnery a ty budou \u017eiv\u00e9 po celou dobu sestavov\u00e1n\u00ed. Situaci m\u016f\u017eete trochu zlep\u0161it zm\u011bnou konfigurace spou\u0161t\u011bn\u00ed z\u00e1suvn\u00e9ho modulu, ale to nesta\u010d\u00ed. V nejhor\u0161\u00edm p\u0159\u00edpad\u011b va\u0161e kontejnery vy\u010derpaj\u00ed syst\u00e9mov\u00e9 prost\u0159edky je\u0161t\u011b p\u0159ed spu\u0161t\u011bn\u00edm test\u016f!<\/p>\n\n\n\n<p>A to nen\u00ed jedin\u00fd probl\u00e9m. Z IDE nelze spustit jedin\u00fd integra\u010dn\u00ed test. P\u0159edt\u00edm mus\u00edte kontejnery spustit ru\u010dn\u011b. Nav\u00edc p\u0159i dal\u0161\u00edm spu\u0161t\u011bn\u00ed Mavenu se tyto kontejnery rozpadnou (pod\u00edvejte se na str\u00e1nku <code>dol\u016f<\/code> proveden\u00ed).<\/p>\n\n\n\n<p>Toto \u0159e\u0161en\u00ed je tedy jako velk\u00e1 n\u00e1kladn\u00ed lo\u010f. Pokud v\u0161e funguje dob\u0159e, je to v po\u0159\u00e1dku. Jak\u00e9koli neo\u010dek\u00e1van\u00e9 nebo neobvykl\u00e9 chov\u00e1n\u00ed vede k tomu. <a href=\"https:\/\/thecodest.co\/cs\/blog\/why-us-companies-are-opting-for-polish-developers\/\">n\u00e1s<\/a> k n\u011bjak\u00e9 katastrof\u011b.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Testovac\u00ed kontejnery - spou\u0161t\u011bn\u00ed kontejner\u016f z test\u016f<\/h2>\n\n\n\n<p>Ale co kdybychom mohli spou\u0161t\u011bt na\u0161e kontejnery z test\u016f? Tento n\u00e1pad vypad\u00e1 dob\u0159e a ji\u017e se realizuje. <a href=\"https:\/\/www.testcontainers.org\/\" rel=\"nofollow\">Testovac\u00ed kontejnery<\/a>, proto\u017ee mluv\u00edme o tomto projektu, zde je \u0159e\u0161en\u00ed na\u0161ich probl\u00e9m\u016f. Nen\u00ed ide\u00e1ln\u00ed, ale nikdo nen\u00ed dokonal\u00fd.<\/p>\n\n\n\n<p>Jedn\u00e1 se o <strong><a href=\"https:\/\/thecodest.co\/cs\/blog\/top-programming-languages-to-build-e-commerce\/\">Java<\/a><\/strong> knihovna, kter\u00e1 podporuje testy JUnit a Spock a poskytuje lehk\u00e9 a snadn\u00e9 zp\u016fsoby, jak spustit <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/docker-developer\/\">Docker<\/a> kontejner. Poj\u010fme se na to pod\u00edvat a napsat n\u011bjak\u00fd k\u00f3d!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">P\u0159edpoklady a konfigurace<\/h3>\n\n\n\n<p>Ne\u017e za\u010dneme, mus\u00edme zkontrolovat na\u0161i konfiguraci. <strong>Zku\u0161ebn\u00ed kontejnery<\/strong> pot\u0159ebuj\u00ed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Docker ve verzi v17.09,<\/li>\n\n\n\n<li>Java minim\u00e1ln\u011b verze 1.8,<\/li>\n\n\n\n<li>P\u0159\u00edstup k s\u00edti, zejm\u00e9na k docker.hub.<\/li>\n<\/ul>\n\n\n\n<p>V\u00edce informac\u00ed o po\u017eadavc\u00edch na konkr\u00e9tn\u00ed opera\u010dn\u00ed syst\u00e9m a CI naleznete zde.<br>na adrese <a href=\"https:\/\/www.testcontainers.org\/supported_docker_environment\/\" rel=\"nofollow\">dokumentace<\/a>.<\/p>\n\n\n\n<p>Nyn\u00ed je \u010das p\u0159idat n\u011bkolik \u0159\u00e1dk\u016f do. <code>pom.xml<\/code>.<\/p>\n\n\n\n<aside>V projektu pou\u017e\u00edv\u00e1m spring boot, abych sn\u00ed\u017eil po\u010det kotl\u016f. <strong>Zku\u0161ebn\u00ed kontejnery<\/strong> jsou nez\u00e1visl\u00e9 na frameworku Spring Framework a m\u016f\u017eete je pou\u017e\u00edvat i bez n\u011bj.<\/aside>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"xml\" class=\"language-xml\">org.testcontainers\n       testcontainers-bom\n       ${testcontaines.version}\n       pom\n       import\n     \n   \n \n \n   \n     org.postgresql\n     postgresql\n     runtime\n   \n   \n     org.testcontainers\n     postgresql\n     test\n   \n   \n     org.testcontainers\n     junit-jupiter\n     test<\/code><\/pre>\n\n\n\n<p>Pou\u017e\u00edv\u00e1m <strong>Zku\u0161ebn\u00ed kontejnery<\/strong> verze <code>1.17.3<\/code>, ale klidn\u011b pou\u017eijte ten nejnov\u011bj\u0161\u00ed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testy s kontejnerem Postgres<\/h3>\n\n\n\n<p>Prvn\u00edm krokem je p\u0159\u00edprava instance kontejneru. To m\u016f\u017eeme ud\u011blat p\u0159\u00edmo v testu, ale l\u00e9pe vypad\u00e1 nez\u00e1visl\u00e1 t\u0159\u00edda.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">public class Postgres13TC extends PostgreSQLContainer {\n\n private static final Postgres13TC TC = new Postgres13TC();\n\n private Postgres13TC() {\n   super(\"postgres:13.2\");\n }\n\n public static Postgres13TC getInstance() {\n   return TC;\n }\n\n @Override\n public void start() {\n   super.start();\n   System.setProperty(\"DB_URL\", TC.getJdbcUrl());\n   System.setProperty(\"DB_USERNAME\", TC.getUsername());\n   System.setProperty(\"DB_PASSWORD\", TC.getPassword());\n }\n\n @Override\n public void stop() {\n   \/\/ nic ned\u011blat. Toto je sd\u00edlen\u00e1 instance. Nechte tuto operaci na JVM.\n }\n}\n<\/code><\/pre>\n\n\n\n<p>Na za\u010d\u00e1tku test\u016f vytvo\u0159\u00edme instanci p\u0159\u00edkazu <code>Postgres13TC<\/code>. Tato t\u0159\u00edda m\u016f\u017ee zpracov\u00e1vat informace o na\u0161em kontejneru. Nejd\u016fle\u017eit\u011bj\u0161\u00ed jsou zde \u0159et\u011bzce p\u0159ipojen\u00ed k datab\u00e1zi a pov\u011b\u0159en\u00ed. Nyn\u00ed je \u010das napsat velmi jednoduch\u00fd test.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">@Testcontainers\nclass SimpleDbTest {\n\n @Container\n private static Postgres13TC = Postgres13TC.getInstance();\n\n @Test\n void testConnection() {\n   assumeThat(postgres13TC.isRunning());\n   var connectionProps = new Properties();\n   connectionProps.put(\"user\", postgres13TC.getUsername());\n   connectionProps.put(\"password\", postgres13TC.getPassword());\n\n   try (Connection = DriverManager.getConnection(postgres13TC.getJdbcUrl(),\n       connectionProps)) {\n     var resultSet = connection.prepareStatement(\"Select 1\").executeQuery();\n     resultSet.next();\n     assertThat(resultSet.getInt(1)).isEqualTo(1);\n   } catch (SQLException sqlException) {\n     assertThat((Exception) sqlException).doesNotThrowAnyException();\n   }\n }\n}<\/code><\/pre>\n\n\n\n<p>Pou\u017e\u00edv\u00e1m zde JUnit 5. Anotace <code>@Testcontainers<\/code> je sou\u010d\u00e1st\u00ed roz\u0161\u00ed\u0159en\u00ed, kter\u00e1 \u0159\u00edd\u00ed kontejnery v testovac\u00edm prost\u0159ed\u00ed. Najdou v\u0161echna pole s <code>@Container<\/code> anotace a kontejnery start a stop.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Testy se Spring Boot<\/h3>\n\n\n\n<p>Jak jsem ji\u017e zm\u00ednil, v projektu pou\u017e\u00edv\u00e1m Spring Boot. V tomto p\u0159\u00edpad\u011b mus\u00edme napsat trochu v\u00edce k\u00f3du. Prvn\u00edm krokem je vytvo\u0159en\u00ed dal\u0161\u00ed konfigura\u010dn\u00ed t\u0159\u00eddy.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">@Slf4j\npublic class ContainerInit implements\n   ApplicationContextInitializer {\n\n public static Postgres13TC;\n\n static {\n   postgres13TC = Postgres13TC.getInstance();\n   postgres13TC.start();\n }\n\n @Override\n public void initialize(ConfigurableApplicationContext applicationContext) {\n   TestPropertySourceUtils.addInlinedPropertiesToEnvironment(\n       applicationContext,\n       \"spring.datasource.url=\" + postgres13TC.getJdbcUrl(),\n       \"spring.datasource.username=\" + postgres13TC.getUsername(),\n       \"spring.datasource.password=\" + postgres13TC.getPassword(),\n       \"db.host=\" + postgres13TC.getHost(),\n       \"db.port=\" + postgres13TC.getMappedPort(postgres13TC.POSTGRESQL_PORT),\n       \"db.name=\" + postgres13TC.getDatabaseName(),\n       \"db.username=\" + postgres13TC.getUsername(),\n       \"db.password=\" + postgres13TC.getPassword()\n   );\n }\n}<\/code><\/pre>\n\n\n\n<p>Tato t\u0159\u00edda p\u0159episuje existuj\u00edc\u00ed vlastnosti hodnotami ze t\u0159\u00eddy <strong>testovac\u00ed kontejner<\/strong>. Prvn\u00ed t\u0159i vlastnosti jsou standardn\u00ed vlastnosti jara. Dal\u0161\u00edch p\u011bt jsou dopl\u0148kov\u00e9, vlastn\u00ed vlastnosti, kter\u00e9 lze pou\u017e\u00edt ke konfiguraci dal\u0161\u00edch zdroj\u016f a roz\u0161\u00ed\u0159en\u00ed, jako je nap\u0159. liquibase:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"properties\" class=\"language-properties\">spring.liquibase.change-log=classpath:\/db\/changelog\/dbchangelog.xml\nspring.liquibase.url=jdbc:postgresql:\/\/${db.host:localhost}:${db.port:5432}\/${db.name:cities}\nspring.liquibase.user=${db.username:admin}\nspring.liquibase.password=${db.password:password}\nspring.liquibase.enabled=true<\/code><\/pre>\n\n\n\n<p>Nyn\u00ed je \u010das definovat jednoduch\u00fd integra\u010dn\u00ed test.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">@SpringBootTest(webEnvironment = RANDOM_PORT)\n@AutoConfigureTestDatabase(replace = NONE)\n@ContextConfiguration(initializers = ContainerInit.class)\n@Testcontainers\nclass DummyRepositoryTest {\n\n @Autowired\n private DummyRepository;\n\n @Test\n void shouldReturnDummy() {\n   var byId = dummyRepository.getById(10L);\n   var expected = new Dummy();\n   expected.setId(10L);\n   assertThat(byId).completes().emitsCount(1).emits(expected);\n }\n}<\/code><\/pre>\n\n\n\n<p>M\u00e1me zde n\u011bkolik dal\u0161\u00edch pozn\u00e1mek.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>@SpringBootTest(webEnvironment = RANDOM_PORT)<\/code> - ozna\u010d\u00ed test jako test Spring Boot a spust\u00ed kontext spring.<\/li>\n\n\n\n<li><code>@AutoConfigureTestDatabase(replace = NONE)<\/code> - tyto anotace \u0159\u00edkaj\u00ed, \u017ee roz\u0161\u00ed\u0159en\u00ed spring test by nem\u011blo v konfiguraci pam\u011bti nahrazovat konfiguraci datab\u00e1ze postgres konfigurac\u00ed H2.<\/li>\n\n\n\n<li><code>@ContextConfiguration(initializers = ContainerInit.class)<\/code> - dal\u0161\u00ed jarn\u00ed kontext<br>konfigurace, kde nastavujeme vlastnosti z <strong>Zku\u0161ebn\u00ed kontejnery<\/strong>.<\/li>\n\n\n\n<li><code>@Testcontainers<\/code> - jak ji\u017e bylo uvedeno, tato anotace \u0159\u00edd\u00ed \u017eivotn\u00ed cyklus kontejneru.<\/li>\n<\/ul>\n\n\n\n<p>V tomto p\u0159\u00edkladu pou\u017e\u00edv\u00e1m reaktivn\u00ed \u00falo\u017ei\u0161t\u011b, ale stejn\u011b to funguje i s b\u011b\u017en\u00fdmi \u00falo\u017ei\u0161ti JDBC a JPA.<\/p>\n\n\n\n<p>Nyn\u00ed m\u016f\u017eeme spustit tento test. Pokud se jedn\u00e1 o prvn\u00ed spu\u0161t\u011bn\u00ed, mus\u00ed engine st\u00e1hnout obrazy z docker.hub. To m\u016f\u017ee chv\u00edli trvat. Pot\u00e9 uvid\u00edme, \u017ee se spustily dva kontejnery. Jeden je postgres a druh\u00fd je \u0159adi\u010d Testcontainers. Tento druh\u00fd kontejner spravuje b\u011b\u017e\u00edc\u00ed kontejnery a i kdy\u017e se JVM ne\u010dekan\u011b zastav\u00ed, pak vypne kontejnery a uklid\u00ed prost\u0159ed\u00ed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Shr\u0148me si to<\/h2>\n\n\n\n<p><strong>Zku\u0161ebn\u00ed kontejnery<\/strong> jsou velmi snadno pou\u017eiteln\u00e9 n\u00e1stroje, kter\u00e9 n\u00e1m pom\u00e1haj\u00ed vytv\u00e1\u0159et integra\u010dn\u00ed testy vyu\u017e\u00edvaj\u00edc\u00ed kontejnery Docker. To n\u00e1m d\u00e1v\u00e1 v\u011bt\u0161\u00ed flexibilitu a zvy\u0161uje rychlost v\u00fdvoje. Spr\u00e1vn\u00e9 nastaven\u00ed konfigurace test\u016f zkracuje \u010das pot\u0159ebn\u00fd k n\u00e1stupu nov\u00fdch v\u00fdvoj\u00e1\u0159\u016f. Nemus\u00ed nastavovat v\u0161echny z\u00e1vislosti, sta\u010d\u00ed jim spustit napsan\u00e9 testy s vybran\u00fdmi konfigura\u010dn\u00edmi soubory.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/thecodest.co\/contact\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/interested_in_cooperation_.png\" alt=\"banner spolupr\u00e1ce\"\/><\/a><\/figure>","protected":false},"excerpt":{"rendered":"<p>Hled\u00e1te zp\u016fsob, jak jednodu\u0161eji prov\u00e1d\u011bt testy? M\u00e1me pro v\u00e1s \u0159e\u0161en\u00ed! Pod\u00edvejte se do n\u00e1sleduj\u00edc\u00edho \u010dl\u00e1nku a zjist\u011bte, jak to prov\u00e9st.<\/p>","protected":false},"author":2,"featured_media":3632,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Test Containers \u2013 How to Make Tests Easier? - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/cs\/blog\/testovaci-kontejnery-jak-usnadnit-testovani\/\" \/>\n<meta property=\"og:locale\" content=\"cs_CZ\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Test Containers \u2013 How to Make Tests Easier?\" \/>\n<meta property=\"og:description\" content=\"Are you looking for a way to make tests in an easier way? We got you! Check the following article and learn how to make it possible.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/cs\/blog\/testovaci-kontejnery-jak-usnadnit-testovani\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-26T11:02:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-11T06:00:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/test_containers_-_how_to_make_tests_easier_.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Test Containers \u2013 How to Make Tests Easier?\",\"datePublished\":\"2022-07-26T11:02:35+00:00\",\"dateModified\":\"2026-03-11T06:00:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/\"},\"wordCount\":1399,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/test_containers_-_how_to_make_tests_easier_.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"cs-CZ\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/\",\"name\":\"Test Containers \u2013 How to Make Tests Easier? - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/test_containers_-_how_to_make_tests_easier_.png\",\"datePublished\":\"2022-07-26T11:02:35+00:00\",\"dateModified\":\"2026-03-11T06:00:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#breadcrumb\"},\"inLanguage\":\"cs-CZ\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"cs-CZ\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/test_containers_-_how_to_make_tests_easier_.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/test_containers_-_how_to_make_tests_easier_.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/test-containers-how-to-make-tests-easier\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Test Containers \u2013 How to Make Tests Easier?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"cs-CZ\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs-CZ\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs-CZ\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/cs\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Testovac\u00ed kontejnery - jak si usnadnit testov\u00e1n\u00ed? - The Codest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/cs\/blog\/testovaci-kontejnery-jak-usnadnit-testovani\/","og_locale":"cs_CZ","og_type":"article","og_title":"Test Containers \u2013 How to Make Tests Easier?","og_description":"Are you looking for a way to make tests in an easier way? We got you! Check the following article and learn how to make it possible.","og_url":"https:\/\/thecodest.co\/cs\/blog\/testovaci-kontejnery-jak-usnadnit-testovani\/","og_site_name":"The Codest","article_published_time":"2022-07-26T11:02:35+00:00","article_modified_time":"2026-03-11T06:00:15+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/test_containers_-_how_to_make_tests_easier_.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Test Containers \u2013 How to Make Tests Easier?","datePublished":"2022-07-26T11:02:35+00:00","dateModified":"2026-03-11T06:00:15+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/"},"wordCount":1399,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/test_containers_-_how_to_make_tests_easier_.png","articleSection":["Software Development"],"inLanguage":"cs-CZ","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/","url":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/","name":"Testovac\u00ed kontejnery - jak si usnadnit testov\u00e1n\u00ed? - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/test_containers_-_how_to_make_tests_easier_.png","datePublished":"2022-07-26T11:02:35+00:00","dateModified":"2026-03-11T06:00:15+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#breadcrumb"},"inLanguage":"cs-CZ","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/"]}]},{"@type":"ImageObject","inLanguage":"cs-CZ","@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/test_containers_-_how_to_make_tests_easier_.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/test_containers_-_how_to_make_tests_easier_.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/test-containers-how-to-make-tests-easier\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Test Containers \u2013 How to Make Tests Easier?"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"cs-CZ"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"cs-CZ","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"cs-CZ","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/cs\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/comments?post=3631"}],"version-history":[{"count":9,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3631\/revisions"}],"predecessor-version":[{"id":8016,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3631\/revisions\/8016"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/media\/3632"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/media?parent=3631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/categories?post=3631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/tags?post=3631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}