test_class.file: 02-spring5-answer/src/test/java/com/example/persistence/config/DataSourceConfigTest.java
test_class.identifier: DataSourceConfigTest
test_case.body: @Test
      @DisplayName("DataSourceのBeanが正しく定義されている")
      public void dataSourceTest() {
          Method dataSourceMethod = assertDoesNotThrow(() -> DataSourceConfig.class.getMethod("dataSource"));
          assertNotNull(dataSourceMethod.getAnnotation(Bean.class), "annotation required");
          EmbeddedDatabase dataSource = new DataSourceConfig().dataSource();
          JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
  
          assertAll("SQL files are not executed correctly",
                  () -> assertEquals(5, JdbcTestUtils.countRowsInTable(jdbcTemplate, "customer")),
                  () -> assertEquals(3, JdbcTestUtils.countRowsInTable(jdbcTemplate, "account")),
                  () -> assertEquals(3, JdbcTestUtils.countRowsInTable(jdbcTemplate, "account_authority"))
          );
      }
test_case.class_method_signature: DataSourceConfigTest.dataSourceTest()
test_case.full_signature: @Test @DisplayName("DataSourceのBeanが正しく定義されている") public void dataSourceTest()
test_case.identifier: dataSourceTest
test_case.invocations: assertDoesNotThrow getMethod assertNotNull getAnnotation dataSource assertAll assertEquals countRowsInTable assertEquals countRowsInTable assertEquals countRowsInTable
test_case.modifiers: @Test @DisplayName("DataSourceのBeanが正しく定義されている") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void dataSourceTest()
focal_class.file: 02-spring5-answer/src/main/java/com/example/persistence/config/DataSourceConfig.java
focal_class.identifier: DataSourceConfig
focal_class.class_method_signature: DataSourceConfig.dataSource()
focal_class.full_signature: @Bean public EmbeddedDatabase dataSource()
focal_class.identifier: dataSource
focal_class.modifiers: @Bean public
focal_class.parameters: ()
focal_class.return: EmbeddedDatabase
focal_class.signature: EmbeddedDatabase dataSource()
focal_method.body: @Bean
      public EmbeddedDatabase dataSource() {
          return new EmbeddedDatabaseBuilder()
                  .setScriptEncoding(StandardCharsets.UTF_8.name())
                  // SQLファイル名を指定する（src/main/resources直下）
                  .addScript("classpath:/schema.sql")
                  .addScript("classpath:/data.sql")
                  .setType(EmbeddedDatabaseType.H2)
                  .build();
      }
focal_method.class_method_signature: DataSourceConfig.dataSource()
focal_method.full_signature: @Bean public EmbeddedDatabase dataSource()
focal_method.identifier: dataSource
focal_method.invocations: build setType addScript addScript setScriptEncoding name
focal_method.modifiers: @Bean public
focal_method.parameters: ()
focal_method.return: EmbeddedDatabase
focal_method.signature: EmbeddedDatabase dataSource()