亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? Java java?? ?? ??/???? ???: Spring Boot ??? ????

??/???? ???: Spring Boot ??? ????

Jan 10, 2025 am 11:03 AM

??

??/???? ???? ?? ??? ???? ?? ?? ??? ??? ?? ??? ???. ? ????? ??? ??? ??? ???? ??? ???? ?? Spring Testcontainers?? ?? ????? ?? ??? ??? ????.
??????? ??? ?? ???? ??? ? ?? CRUD ??? ?? ?? ???? ???. ?? TestDeleteUserByID_ShouldReturnOk()? ?? ???? 2015??? ??? ???? ?? ??? ??? ??? '???' ????? ??? ? ?? ?? ??? ?????? ???? ?? ?????. ??♂?
??? ??? ???? ?? ??? ???? ???? ?????? ????? ?? ???? ??? ? ????. ?? ??, ???? ???? ???? ?? ????? ??? ?? ???? ???? ??????? ?? ??? ??? ? ????.
??? ?? ?? ??? ??? ?????. ???? ??????

Dev/prod parity : Spring Boot Testcontainers

??? ???? ??? ???? ?? ?? ??? ???? ???? ???? ???? ???? ??? ???? ??? ??????? ??? ??? ?? ???.

?? H2DB? ?? ???? ??????? ??? ?? ?? ????? ? ?? ??? ????. ??? ??? ?? H2DB? RDBMS? ??? ??? ?? ??? ???? ???? ??? ??? ?? ???? ?? ? ??? ??? ? ????.

https://stackoverflow.com/questions/62778900/syntax-error-h2-database-in-postgresql-compatibility

??? ?? ?? ???? ??????? ???? ????? ??? ???? ? ??? ?? ??? ???? ????. ??? ? ???? ??? ????. ORM? ???? ?????? ???? ?? ? ??? ?????? ?? ???? ??? ?? ??????? ??? ??? ???? ??? ?? ???? ???.


??????, ??? ??? ? ?????? ? ?? ?? ?? ??????.

"Testcontainers? JUnit ???? ???? Java ??????, ?? ??????, Selenium ? ???? ?? Docker ?????? ??? ? ?? ?? ??? ??? ??? ????? ?????."

?? Java??? ?????? ?? Go, Rust ? .NET? ?? ?? ??? ????? ???????.

Testcontainers? ?? ????? IDE?? ??? ? ?? ??? ???? ???? ????. ??? ?? ???? ???? ??? ?? ?? ?? ??? ?? ???? ??? ? ????.

?? ????? ? ??? ??? ???.

  • Docker ????? ???? ??? ???? ???? ???? ???? ? ??? ??? ???? ????? ??????? ?????.
  • ???? ????? ???? ?????.
  • ???? ???? ???? ???? ???? ??

??? ???? ????? ??


Spring Boot ??? ???? ??

?? ???? ?? ???? ApplicationIntegrationTests??? ?? PostgreSQLContainer? ?????. ? ????? ? ????? ??? ?? ??? ?????? ?????.

@Testcontainers ??? ???? @Container ??? ?? ?? ??? ???? ?? ???? ?? ?? ???? ???? ????? ??? ? ????.

  • ?? ??? ??? ????? ??? ??? ?? ?????. ??? ???? ???? ?? ? ?? ???? ??? ??? ???? ??? ?? ?????.
  • ???? ??? ??? ????? ??? ????? ???? ?????.

@DynamicPropertySource ??? ???? ??? ??? ??? ???? ??? ? ????.

@Testcontainers
@ActiveProfiles("test")
public abstract class ApplicationIntegrationTests {
    @Container
    protected static PostgreSQLContainer<?> postgres=new PostgreSQLContainer<>("postgres:17.2-alpine")
            .withDatabaseName("testcontainersproject")
            .withUsername("root")
            .withPassword("root");

    @DynamicPropertySource
    static void initialize(DynamicPropertyRegistry registry)
    {
        registry.add("spring.datasource.url",postgres::getJdbcUrl);
        registry.add("spring.datasource.username",postgres::getUsername);
        registry.add("spring.datasource.password",postgres::getPassword);
    }


}

?? @Testcontainers ? @Container ??? ???? ?? @BeforeAll ? @AfterAll? ???? ???? ????? ?? ??? ? ????. ? ?? ??? ???? ????? ???? ???? ??? ??? ? ????? ??? ? ????

@BeforeAll
public static void runContainer(){
        postgres.start();
}
@AfterAll
static void stopContainers() {
    postgres.stop();
}

@AfterAll ?? ?????? Postgres ????? ????? ?????. ??? ????? ????? ???? ???? Testcontainers? ??? ??? ??? ???? ????? ???? ?????.

?? ??? ?? ApplicationIntegrationTests? ???? ?? ???? ??? ? ????.

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
public class CategoryControllerTest extends ApplicationIntegrationTests {
    private static final String CATEGORY_ENDPOINT="/categories";
   @Autowired
    private MockMvc mockMvc;
    @Autowired
    private CategoryRepository categoryRepository;

    @Test
    void TestGetAllCategories_ShouldReturnOk() throws Exception {

        List<Category> categories = List.of(
                new Category("Electronics", "All kinds of electronic gadgets from smartphones to laptops"),
                new Category("Books", "A wide range of books from novels to educational textbooks")
        );
        categoryRepository.saveAll(categories);
        MvcResult mvcResult=mockMvc.perform(
                get(CATEGORY_ENDPOINT).
                        contentType(MediaType.APPLICATION_JSON)
        )
                .andExpect(status().isOk())
                .andReturn();
        var response=mvcResult.getResponse().getContentAsString();
        assertNotNull(response);
        assertFalse(response.isEmpty());
    }
}

? ??? ??/???? ???: Spring Boot ??? ????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1596
29
PHP ????
1480
72
NYT ?? ??? ??
128
836
???
Java? 'Enum'??? ?????? Java? 'Enum'??? ?????? Jul 02, 2025 am 01:31 AM

Java? ??? ?? ? ?? ?? ?? ???? ?? ??????. 1. ?? ??? ??? ??????. 2. ? ?? ?? ?? ??? ?? ?? ?? ???????. 3. ? ??? ??? ???? ??, ??? ? ??? ?? ? ? ????. 4. ??? ?? ??? ? ??, ?? ??? ????, name (), ordinal (), value () ? valueof ()? ?? ?? ???? ?????. 5. ??? ??? ?? ??, ??? ? ???? ???? ? ??? ?? ??, ?? ?? ?? ?? ??? ?? ????? ?????.

????? ?? ??? ?????? ????? ?? ??? ?????? Jul 02, 2025 am 01:24 AM

????? ?? ?? (ISP)? ?????? ???? ?? ?????? ???? ??????. ??? ?? ??? ?????? ?? ?? ?? ??? ?????? ???? ????. ? ??? ???? ??? ?????. ???? ?????? ???? ?? ?? ???? ?? ??? ???? ???? ??? ??? ?????? ??? ?????. ?? ???? ???? ??? ????? : ?? ??? ?? ?????? ??? ?????? ?? ?? ????? ?? ? ??? ?? ?? ????? ?? ?? ??? ?????. ?? ??, ??, ?? ? ?? ??? ?? ? ?? ?????? ???, ??? ? ??? ??????. ??? ???? ?? ?? ?????? ?? ??? ??? ? ??? ???? ?? ? ? ????.

?? ??? ??? ????? ?? ?? ??? ??? ????? ?? Jul 07, 2025 am 02:24 AM

Java? ??? ?? ??, ?? ? ??? (? : Projectreactor) ? Java19? ?? ???? ??? ??? ?????? ?????. 1. CompletableFuture? ?? ??? ?? ?? ??? ? ?? ??? ????? ?? ??????? ? ?? ??? ?????. 2. Projectreactor? ?? ? ??? ??? ???? ?? ???? ? ??? ???? ?? ? ?????? ?????. 3. ?? ???? ??? ??? ??? I/O ??? ? ??? ???? ?? ??? ????? ??? ???? ????. ? ???? ?? ??? ????? ??? ??? ??? ?? ??? ??? ?????? ???? ???? ?? ?? ??? ??????.

Java?? ?? ??? ???? ??? Java?? ?? ??? ???? ??? Jul 04, 2025 am 02:50 AM

Java??? ?? ??? ????? ? ?? ?? ???? ????. ??, ?? ??? ??? ??? ?? ? ? ???, ?? ?? ?? ??? ?? ?? ?? ???? ??? ?????. Runnable? run () ????? ?? ?? ??? ??? ?? ?? ? ????? ??? ?????. ??, Callable? ?? ??? ?????? ?? ?? ? ??? ?? ? ????. ?? ????? ????? ??? ???????. ??, Runnable? ??? ?? ExecutorService? ?? ?? ? ? ??? Callable? ExecutorService?? ??? ? ??? ?? ??? ?? ? ? ????.

Java Nio? ? ??? ????? Java Nio? ? ??? ????? Jul 08, 2025 am 02:55 AM

Javanio? Java 1.4? ?? ? ??? IOAPI???. 1) ?? ? ??? ?????, 2) ??, ?? ? ??? ?? ?? ??, 3) ? ??? ??? ???? 4) ?? ??? ?? IO?? ? ????? ?????. 1) ? ?? IO? ??? ?? ??? ???, 2) ??? ??? ?? ???? ?????, 3) ???? ?????? ???? 4) ??? ?? ??? ?? ?? ? ??? ?????. 1) ??? ??/??? ??? ?? ?????, 2) ???? ???? ???? ?? ???? ???????. 3) ??? ??? ??? ???????.

???? ??? ?????? ?? ?? ???? ??? ?????? ?? ?? Jul 07, 2025 am 02:35 AM

Java?? ??? ?? ?? ??? ???? ? ?????. ?? ???? ??? ?????. 1. ?? ?? ? ???? ??????? ?? ?? ?? ??? ???? ??? ?????. 2. ?? ??, ???, ??? ?? ?? ?? ???? ????? ?? ??? ??? ??? ?????. 3. ENUMMAP ? ENUMSET? ???? ?? ? ?? ???? ???? ??? ???? ? ?????? ?????. 4. ?? ?, ??? ?? ?? ??? ?? ????? ?? ??? ??? ?????.? ????? ?? ???? ????????. ??? ???? ???? ?? ??? ????? ??? ?? ? ??? ?? ?????? ???????.

Java ??? ??? ????? ???? ?? Java ??? ??? ????? ???? ?? Jul 06, 2025 am 02:53 AM

Java? ????? ????? ??? ??? ?? ???? ?? ?? ??????, ?? ? ???? ? ??? ????. ?? ???? ??? ??? ???? ??? ??? ???? ?? ??? ??? ????. ???? ???? ??? ??, ?? ??? ???? ???? ?? ??? ?? ???? ?? ?????. ???? ?? ?? ??? ?? ?? ??? ?????. ?????? ?? ??? ??? ???? ?? ??? ??? ?? ??? ???? ???? ??? ?? ??? ?????? ???? ????? ??? ?? ?? ???, ?? ? ?? ???? ??? ??? ?????. ???? urlclassl? ?? ??? ??? ??? ?? ? ? ????

Java? ?? ??? ???? ?? Java? ?? ??? ???? ?? Jul 04, 2025 am 02:53 AM

JavaprovidesmultiplesynchronizationToolsforthreadsAfety.1.SynchronizedBlocksensUremutualExclusionByLockingMethodSorspecificCodesections.2.reentrantLockofferAdcerAdcenctrol, ratelockandFairnessPolicies.3.ConditionVariablesStowFor

See all articles