├── .gitattributes ├── .gitignore ├── 9781484251355.jpg ├── Contributing.adoc ├── Errata.pdf ├── LICENSE.txt ├── README.adoc ├── build.gradle ├── chapter00 ├── chapter00.gradle ├── dao │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ ├── com │ │ └── apress │ │ │ └── cems │ │ │ ├── dao │ │ │ ├── AbstractEntity.java │ │ │ ├── CriminalCase.java │ │ │ ├── Detective.java │ │ │ ├── Evidence.java │ │ │ ├── Person.java │ │ │ ├── Storage.java │ │ │ └── TrackEntry.java │ │ │ ├── dto │ │ │ ├── CriteriaDto.java │ │ │ └── FieldGroup.java │ │ │ ├── ex │ │ │ ├── ConfigurationException.java │ │ │ └── UnexpectedException.java │ │ │ └── util │ │ │ ├── CaseStatus.java │ │ │ ├── CaseType.java │ │ │ ├── DateProcessor.java │ │ │ ├── EmploymentStatus.java │ │ │ ├── Functions.java │ │ │ ├── NumberGenerator.java │ │ │ ├── Rank.java │ │ │ └── TrackAction.java │ │ └── module-info.java └── repos │ ├── build.gradle │ └── src │ └── main │ └── java │ ├── com │ └── apress │ │ └── cems │ │ └── repos │ │ ├── AbstractRepo.java │ │ ├── ApressRepo.java │ │ ├── CriminalCaseRepo.java │ │ ├── DetectiveRepo.java │ │ ├── EvidenceRepo.java │ │ ├── NotFoundException.java │ │ ├── PersonRepo.java │ │ ├── StorageRepo.java │ │ ├── TrackEntryRepo.java │ │ ├── impl │ │ ├── JdbcAbstractRepo.java │ │ ├── JdbcCriminalCaseRepo.java │ │ ├── JdbcDetectiveRepo.java │ │ ├── JdbcEvidenceRepo.java │ │ ├── JdbcPersonRepo.java │ │ ├── JdbcStorageRepo.java │ │ └── JdbcTrackEntryRepo.java │ │ └── util │ │ ├── CriminalCaseRowMapper.java │ │ ├── DetectiveRowMapper.java │ │ ├── PersonRowMapper.java │ │ └── StorageRowMapper.java │ └── module-info.java ├── chapter02 ├── beans-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── beans │ │ │ │ ├── Book.java │ │ │ │ ├── Human.java │ │ │ │ ├── HumanAppCfg.java │ │ │ │ ├── Item.java │ │ │ │ └── Person.java │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── beans │ │ └── HumanAppCfgTest.java ├── beans │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── beans │ │ │ │ ├── aw │ │ │ │ ├── BadBean.java │ │ │ │ ├── BadBeanImpl.java │ │ │ │ ├── BeanTwo.java │ │ │ │ ├── BeanTwoImpl.java │ │ │ │ ├── MissingBean.java │ │ │ │ ├── MissingBeanImpl.java │ │ │ │ └── NotRequiredBeanCfg.java │ │ │ │ ├── ci │ │ │ │ ├── Book.java │ │ │ │ ├── ComposedBean.java │ │ │ │ ├── ComposedBeanImpl.java │ │ │ │ ├── Human.java │ │ │ │ ├── Item.java │ │ │ │ ├── Person.java │ │ │ │ ├── SimpleAppCfg.java │ │ │ │ ├── SimpleBean.java │ │ │ │ └── SimpleBeanImpl.java │ │ │ │ ├── db │ │ │ │ ├── DependantBean.java │ │ │ │ ├── DependantBeanImpl.java │ │ │ │ └── SimpleDependantCfg.java │ │ │ │ ├── fi │ │ │ │ ├── BadComposedBean.java │ │ │ │ └── FiAppCfg.java │ │ │ │ ├── inheritance │ │ │ │ ├── ChildBean.java │ │ │ │ ├── FamilyAppConfig.java │ │ │ │ └── ParentBean.java │ │ │ │ ├── misc │ │ │ │ ├── MiscAppCfg.java │ │ │ │ ├── NoTaxFormula.java │ │ │ │ ├── ScotlandRateFormula.java │ │ │ │ ├── SimpleSingleton.java │ │ │ │ ├── TaxFormula.java │ │ │ │ └── TaxFormulaFactory.java │ │ │ │ ├── naming │ │ │ │ └── AliasesCfg.java │ │ │ │ ├── required │ │ │ │ ├── SteeringWheel.java │ │ │ │ ├── four │ │ │ │ │ ├── OptionalPartsCar.java │ │ │ │ │ └── OptionalPartsCarConfig.java │ │ │ │ ├── one │ │ │ │ │ ├── Car.java │ │ │ │ │ └── CarConfig.java │ │ │ │ ├── three │ │ │ │ │ ├── YetAnotherCar.java │ │ │ │ │ └── YetAnotherCarConfig.java │ │ │ │ └── two │ │ │ │ │ ├── AnotherCar.java │ │ │ │ │ └── AnotherCarConfig.java │ │ │ │ ├── scalars │ │ │ │ ├── AppConvertersCfg.java │ │ │ │ ├── CollectionHolder.java │ │ │ │ ├── Creature.java │ │ │ │ ├── EmptyCollectionHolder.java │ │ │ │ ├── MultipleTypesBean.java │ │ │ │ ├── PersonBean.java │ │ │ │ ├── StringToDate.java │ │ │ │ ├── StringToLocalDate.java │ │ │ │ └── ToDateConversionException.java │ │ │ │ ├── si │ │ │ │ ├── AnotherComposedBean.java │ │ │ │ ├── AnotherComposedBeanImpl.java │ │ │ │ ├── AnotherSimpleAppCfg.java │ │ │ │ └── AnotherSimpleBeanImpl.java │ │ │ │ └── weird │ │ │ │ ├── WeirdBean.java │ │ │ │ └── WeirdCfg.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── beans │ │ │ ├── aw │ │ │ └── NotRequiredBeanCfgTest.java │ │ │ ├── ci │ │ │ └── SimpleAppCfgTest.java │ │ │ ├── db │ │ │ └── SimpleDependantCfgTest.java │ │ │ ├── fi │ │ │ └── FiAppCfgTest.java │ │ │ ├── inheritance │ │ │ └── FamilyAppConfigTest.java │ │ │ ├── misc │ │ │ └── MiscAppCfgTest.java │ │ │ ├── naming │ │ │ └── AliasesCfgTest.java │ │ │ ├── required │ │ │ └── RequiredTest.java │ │ │ ├── scalars │ │ │ └── AppConvertersCfgTest.java │ │ │ ├── si │ │ │ └── AnotherSimpleAppCfgTest.java │ │ │ ├── weird │ │ │ └── WeirdCfgTest.java │ │ │ └── xml │ │ │ ├── ci │ │ │ └── SimpleAppCfgTest.java │ │ │ ├── misc │ │ │ ├── TaxFormulaFactoryBean.java │ │ │ ├── XMLMiscAppCfgTest.java │ │ │ └── XMLTaxFormulaFactory.java │ │ │ ├── scalars │ │ │ └── AppCfgTest.java │ │ │ └── si │ │ │ └── AnotherSimpleAppCfgTest.java │ │ └── resources │ │ ├── logback-test.xml │ │ └── spring │ │ ├── application-ci-cfg.xml │ │ ├── application-misc-cfg.xml │ │ ├── application-scalars-cfg.xml │ │ └── application-si-cfg.xml ├── boot │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── BeanManager.java │ │ │ │ ├── boot1 │ │ │ │ ├── ApplicationOne.java │ │ │ │ └── CtxController.java │ │ │ │ ├── boot2 │ │ │ │ └── ApplicationTwo.java │ │ │ │ └── boot3 │ │ │ │ └── ApplicationThree.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ └── resources │ │ └── application-test.yml ├── chapter02.gradle ├── config-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ ├── config │ │ │ │ │ └── FullConfig.java │ │ │ │ │ ├── fun │ │ │ │ │ ├── DepBean.java │ │ │ │ │ ├── FunBean.java │ │ │ │ │ └── FunBeanConfig.java │ │ │ │ │ ├── repos │ │ │ │ │ ├── JdbcAbstractRepo.java │ │ │ │ │ ├── JdbcCriminalCaseRepo.java │ │ │ │ │ ├── JdbcDetectiveRepo.java │ │ │ │ │ ├── JdbcEvidenceRepo.java │ │ │ │ │ ├── JdbcPersonRepo.java │ │ │ │ │ ├── JdbcStorageRepo.java │ │ │ │ │ └── JdbcTrackEntryRepo.java │ │ │ │ │ └── scopes │ │ │ │ │ ├── AppConfig.java │ │ │ │ │ ├── Employee.java │ │ │ │ │ └── Salary.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── db │ │ │ └── datasource.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── config │ │ │ └── FullConfigTest.java │ │ │ ├── fun │ │ │ └── FunBeanConfigPracticeTest.java │ │ │ └── scopes │ │ │ └── AppConfigTest.java │ │ └── resources │ │ └── logback-test.xml ├── config │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ ├── config │ │ │ │ │ ├── ProdDataSourceConfig.java │ │ │ │ │ └── RepositoryConfig.java │ │ │ │ │ ├── fun │ │ │ │ │ ├── DepBean.java │ │ │ │ │ ├── FunBean.java │ │ │ │ │ └── FunBeanConfig.java │ │ │ │ │ ├── ib │ │ │ │ │ ├── ComplexBean.java │ │ │ │ │ └── InitializationBeanConfig.java │ │ │ │ │ ├── im │ │ │ │ │ ├── AcbConfig.java │ │ │ │ │ └── AnotherComplexBean.java │ │ │ │ │ ├── lc │ │ │ │ │ ├── AnotherSimpleBean.java │ │ │ │ │ ├── ComplexBean.java │ │ │ │ │ ├── DataSourceCfg.java │ │ │ │ │ ├── SimpleBean.java │ │ │ │ │ └── SimpleConfig.java │ │ │ │ │ ├── repos │ │ │ │ │ ├── JdbcAbstractRepo.java │ │ │ │ │ ├── JdbcCriminalCaseRepo.java │ │ │ │ │ ├── JdbcDetectiveRepo.java │ │ │ │ │ ├── JdbcEvidenceRepo.java │ │ │ │ │ ├── JdbcPersonRepo.java │ │ │ │ │ ├── JdbcStorageRepo.java │ │ │ │ │ └── JdbcTrackEntryRepo.java │ │ │ │ │ ├── repos2 │ │ │ │ │ ├── JPACriminalCaseRepo.java │ │ │ │ │ ├── JdbcCriminalCaseRepo.java │ │ │ │ │ └── RepoConfig.java │ │ │ │ │ ├── scopes │ │ │ │ │ ├── noproxy │ │ │ │ │ │ ├── AppConfig.java │ │ │ │ │ │ ├── Employee.java │ │ │ │ │ │ └── Salary.java │ │ │ │ │ └── proxy │ │ │ │ │ │ ├── AppConfig.java │ │ │ │ │ │ ├── Employee.java │ │ │ │ │ │ └── Salary.java │ │ │ │ │ └── scopes2 │ │ │ │ │ ├── AppConfig.java │ │ │ │ │ ├── Employee.java │ │ │ │ │ ├── Salary.java │ │ │ │ │ ├── SalaryIdea.java │ │ │ │ │ └── SalaryScope.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── db │ │ │ └── prod-datasource.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── config │ │ │ ├── BootstrapDatasourceTest.java │ │ │ ├── EnvTestDataSourceConfig.java │ │ │ ├── MultipleResourcesTest.java │ │ │ ├── ProfilesTest.java │ │ │ ├── TestDataSourceConfig.java │ │ │ ├── TestDataSourceConfigTest.java │ │ │ └── TestProfileDataSourceConfig.java │ │ │ ├── fun │ │ │ └── FunBeanConfigTest.java │ │ │ ├── ib │ │ │ └── InitializationBeanConfigTest.java │ │ │ ├── icm │ │ │ └── AcbConfigTest.java │ │ │ ├── lc │ │ │ └── ApplicationContextTest.java │ │ │ ├── repos2 │ │ │ └── TestRepoCfg.java │ │ │ ├── scopes │ │ │ ├── noproxy │ │ │ │ └── AppConfigTest.java │ │ │ └── proxy │ │ │ │ └── AppConfigTest.java │ │ │ ├── scopes2 │ │ │ └── AppConfigTest.java │ │ │ └── simple │ │ │ ├── OneBeanConfig.java │ │ │ ├── OneSimpleConfigTest.java │ │ │ └── SimpleConfig.java │ │ └── resources │ │ ├── db │ │ ├── test-datasource.properties │ │ └── test2-datasource.properties │ │ └── logback-test.xml ├── pojos-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── pojos │ │ │ │ ├── repos │ │ │ │ ├── AbstractRepo.java │ │ │ │ ├── CriminalCaseRepo.java │ │ │ │ ├── DetectiveRepo.java │ │ │ │ ├── EvidenceRepo.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── StorageRepo.java │ │ │ │ └── TrackEntryRepo.java │ │ │ │ └── services │ │ │ │ ├── AbstractService.java │ │ │ │ ├── CriminalCaseService.java │ │ │ │ ├── DetectiveService.java │ │ │ │ ├── EvidenceService.java │ │ │ │ ├── OperationsService.java │ │ │ │ ├── ServiceException.java │ │ │ │ ├── StorageService.java │ │ │ │ ├── TrackEntryService.java │ │ │ │ └── impl │ │ │ │ ├── SimpleAbstractService.java │ │ │ │ ├── SimpleCriminalCaseService.java │ │ │ │ ├── SimpleDetectiveService.java │ │ │ │ ├── SimpleEvidenceService.java │ │ │ │ ├── SimpleOperationsService.java │ │ │ │ ├── SimpleStorageService.java │ │ │ │ └── SimpleTrackEntryService.java │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── pojos │ │ ├── repos │ │ └── stub │ │ │ ├── StubAbstractRepo.java │ │ │ ├── StubCriminalCaseRepo.java │ │ │ ├── StubDetectiveRepo.java │ │ │ ├── StubEvidenceRepo.java │ │ │ ├── StubPersonRepo.java │ │ │ ├── StubStorageRepo.java │ │ │ └── StubTrackEntryRepo.java │ │ └── services │ │ ├── SimpleOperationsServiceTest.java │ │ └── SimpleServiceTestBase.java ├── pojos │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── pojos │ │ │ │ ├── repos │ │ │ │ ├── AbstractRepo.java │ │ │ │ ├── CriminalCaseRepo.java │ │ │ │ ├── DetectiveRepo.java │ │ │ │ ├── EvidenceRepo.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── StorageRepo.java │ │ │ │ └── TrackEntryRepo.java │ │ │ │ └── services │ │ │ │ ├── AbstractService.java │ │ │ │ ├── CriminalCaseService.java │ │ │ │ ├── DetectiveService.java │ │ │ │ ├── EvidenceService.java │ │ │ │ ├── OperationsService.java │ │ │ │ ├── ServiceException.java │ │ │ │ ├── StorageService.java │ │ │ │ ├── TrackEntryService.java │ │ │ │ └── impl │ │ │ │ ├── SimpleAbstractService.java │ │ │ │ ├── SimpleCriminalCaseService.java │ │ │ │ ├── SimpleDetectiveService.java │ │ │ │ ├── SimpleEvidenceService.java │ │ │ │ ├── SimpleOperationsService.java │ │ │ │ ├── SimpleStorageService.java │ │ │ │ └── SimpleTrackEntryService.java │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── pojos │ │ ├── repos │ │ └── stub │ │ │ ├── StubAbstractRepo.java │ │ │ ├── StubCriminalCaseRepo.java │ │ │ ├── StubDetectiveRepo.java │ │ │ ├── StubEvidenceRepo.java │ │ │ ├── StubPersonRepo.java │ │ │ ├── StubStorageRepo.java │ │ │ └── StubTrackEntryRepo.java │ │ └── services │ │ ├── SimpleOperationsServiceTest.java │ │ └── SimpleServiceTestBase.java └── xml │ ├── README.adoc │ ├── build.gradle │ ├── docker_developer_tier.png │ ├── kitematic_view.png │ ├── sql_developer_connection.png │ └── src │ ├── main │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── xml │ │ │ │ └── repos │ │ │ │ └── impl │ │ │ │ ├── JdbcAbstractRepo.java │ │ │ │ ├── JdbcCriminalCaseRepo.java │ │ │ │ ├── JdbcDetectiveRepo.java │ │ │ │ ├── JdbcEvidenceRepo.java │ │ │ │ ├── JdbcPersonRepo.java │ │ │ │ ├── JdbcStorageRepo.java │ │ │ │ └── JdbcTrackEntryRepo.java │ │ └── module-info.java │ └── resources │ │ ├── db │ │ └── datasource.properties │ │ ├── logback.xml │ │ └── spring │ │ └── application-cfg-prod.xml │ └── test │ ├── java │ └── com │ │ └── apress │ │ └── cems │ │ └── xml │ │ └── ApplicationContextTest.java │ └── resources │ ├── application-opt-prod.xml │ └── logback-test.xml ├── chapter03 ├── boot-test │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── boot │ │ │ │ ├── Application.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── ctr │ │ │ │ ├── IndexController.java │ │ │ │ └── PersonController.java │ │ │ │ ├── entities │ │ │ │ └── Person.java │ │ │ │ ├── repos │ │ │ │ └── PersonRepo.java │ │ │ │ └── services │ │ │ │ ├── PersonService.java │ │ │ │ └── PersonServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── boot │ │ │ ├── ApplicationTest.java │ │ │ └── ApplicationWebTest.java │ │ └── resources │ │ └── application.yml ├── chapter03.gradle ├── junit-tests │ ├── build.gradle │ └── src │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ ├── easymock │ │ └── SimpleDetectiveServiceTest.java │ │ ├── jmock │ │ └── SimpleEvidenceServiceTest.java │ │ ├── mockito │ │ ├── SimpleStorageServiceSecondTest.java │ │ ├── SimpleStorageServiceTest.java │ │ └── SimpleStorageServiceThirdTest.java │ │ └── stub │ │ └── services │ │ └── SimpleCriminalCaseServiceTest.java ├── jupiter-tests │ ├── build.gradle │ └── src │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ ├── easymock │ │ └── SimpleDetectiveServiceTest.java │ │ ├── jmock │ │ └── SimpleEvidenceServiceTest.java │ │ ├── mockito │ │ ├── SimpleStorageServiceTest.java │ │ ├── SimpleStorageServiceTest2.java │ │ └── SimpleStorageServiceTest3.java │ │ └── stub │ │ └── services │ │ └── SimpleCriminalCaseServiceTest.java ├── spring-profiles │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── jupiter │ │ │ │ │ └── cfg │ │ │ │ │ ├── AllConfig.java │ │ │ │ │ ├── AppConfig.java │ │ │ │ │ ├── db │ │ │ │ │ └── ProdDbConfig.java │ │ │ │ │ └── repos │ │ │ │ │ └── ReposConfig.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── db │ │ │ └── prod-datasource.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── jupiter │ │ │ └── cfg │ │ │ │ └── TestDbConfig.java │ │ │ ├── profiles │ │ │ └── SampleProfileConfigTest.java │ │ │ └── repos │ │ │ └── RepositoryTest.java │ │ └── resources │ │ ├── db │ │ ├── schema.sql │ │ ├── test-data.sql │ │ └── test-datasource.properties │ │ └── logback-test.xml ├── spring-tests-junit │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── junit │ │ │ │ └── cfg │ │ │ │ └── repos │ │ │ │ └── ReposConfig.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── ContextLoadingTest.java │ │ │ ├── junit │ │ │ ├── cfg │ │ │ │ └── TestDbConfig.java │ │ │ └── mock │ │ │ │ └── SpringUnitTest.java │ │ │ └── repos │ │ │ ├── RepositoryTest.java │ │ │ └── RepositoryTest2.java │ │ └── resources │ │ ├── db │ │ ├── schema.sql │ │ ├── test-data.sql │ │ └── test-datasource.properties │ │ └── logback-test.xml ├── spring-tests-jupiter │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── jupiter │ │ │ │ └── cfg │ │ │ │ └── repos │ │ │ │ └── ReposConfig.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── jupiter │ │ │ ├── cfg │ │ │ └── TestDbConfig.java │ │ │ ├── mock │ │ │ └── SpringUnitTest.java │ │ │ └── testrepos │ │ │ ├── RepositoryTest.java │ │ │ ├── RepositoryTest2.java │ │ │ ├── RepositoryTest3.java │ │ │ ├── RepositoryTest4.java │ │ │ ├── RepositoryTest5.java │ │ │ └── RepositoryTest6.java │ │ └── resources │ │ ├── db │ │ ├── person-schema.sql │ │ ├── schema.sql │ │ ├── test-data-one.sql │ │ ├── test-data-two.sql │ │ ├── test-data.sql │ │ └── test-datasource.properties │ │ └── logback-test.xml ├── spring-tests-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── module-info.java │ │ │ └── repos │ │ │ └── ReposConfig.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── jupiter │ │ │ └── cfg │ │ │ │ └── TestDbConfig.java │ │ │ ├── mockito │ │ │ └── MockPersonServiceTest.java │ │ │ ├── spring │ │ │ └── PersonRepoTest.java │ │ │ └── stub │ │ │ └── SimpleCriminalCaseServiceTest.java │ │ └── resources │ │ ├── db │ │ ├── schema.sql │ │ ├── test-data-one.sql │ │ ├── test-data-two.sql │ │ ├── test-data.sql │ │ └── test-datasource.properties │ │ └── logback-test.xml └── test-base │ ├── build.gradle │ └── src │ └── main │ └── java │ ├── com │ └── apress │ │ └── cems │ │ ├── services │ │ ├── AbstractService.java │ │ ├── CriminalCaseService.java │ │ ├── DetectiveService.java │ │ ├── EvidenceService.java │ │ ├── OperationsService.java │ │ ├── PersonService.java │ │ ├── ServiceException.java │ │ ├── StorageService.java │ │ ├── TrackEntryService.java │ │ └── impl │ │ │ ├── SimpleAbstractService.java │ │ │ ├── SimpleCriminalCaseService.java │ │ │ ├── SimpleDetectiveService.java │ │ │ ├── SimpleEvidenceService.java │ │ │ ├── SimpleOperationsService.java │ │ │ ├── SimplePersonService.java │ │ │ ├── SimpleStorageService.java │ │ │ └── SimpleTrackEntryService.java │ │ └── stub │ │ ├── repo │ │ ├── StubAbstractRepo.java │ │ ├── StubCriminalCaseRepo.java │ │ ├── StubDetectiveRepo.java │ │ ├── StubEvidenceRepo.java │ │ ├── StubPersonRepo.java │ │ ├── StubStorageRepo.java │ │ └── StubTrackEntryRepo.java │ │ └── util │ │ └── TestObjectsBuilder.java │ └── module-info.java ├── chapter04 ├── aop-base │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── aop │ │ │ │ └── classic │ │ │ │ └── NativePersonRepo.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── aop │ │ │ └── cfg │ │ │ └── classic │ │ │ └── PersonNativeTest.java │ │ └── resources │ │ └── db │ │ ├── schema.sql │ │ └── test-data.sql ├── aop-extras │ ├── README.adoc │ ├── build.gradle │ ├── self-invocation-hoax.jpg │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── aop │ │ │ │ └── extras │ │ │ │ ├── AppConfig.java │ │ │ │ ├── CallerBean.java │ │ │ │ ├── SimpleAspect.java │ │ │ │ └── TargetBean.java │ │ │ └── module-info.java │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── aop │ │ └── extras │ │ └── AppConfigTest.java ├── aop-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── aop │ │ │ │ ├── PersonMonitor.java │ │ │ │ ├── PointcutContainer.java │ │ │ │ ├── config │ │ │ │ └── AopConfig.java │ │ │ │ └── service │ │ │ │ ├── PersonService.java │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── aop │ │ │ ├── PersonMonitorTest.java │ │ │ └── test │ │ │ └── TestDbConfig.java │ │ └── resources │ │ ├── db │ │ ├── schema.sql │ │ └── test-data.sql │ │ └── logback-test.xml ├── aop-xml │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── aop │ │ │ │ │ └── xml │ │ │ │ │ └── PersonRepoMonitor.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── spring │ │ │ └── aop-config.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── aop │ │ │ ├── test │ │ │ └── TestDbConfig.java │ │ │ └── xml │ │ │ └── TestPersonRepoMonitor.java │ │ └── resources │ │ ├── db │ │ ├── schema.sql │ │ └── test-data.sql │ │ └── logback-test.xml ├── aop │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── aop │ │ │ │ ├── ApressService.java │ │ │ │ ├── PersonMonitor.java │ │ │ │ ├── PointcutContainer.java │ │ │ │ ├── StorageMonitor.java │ │ │ │ ├── config │ │ │ │ └── AopConfig.java │ │ │ │ ├── exception │ │ │ │ └── MailSendingException.java │ │ │ │ ├── service │ │ │ │ ├── DetectiveService.java │ │ │ │ ├── PersonService.java │ │ │ │ ├── PersonServiceImpl.java │ │ │ │ ├── StorageService.java │ │ │ │ └── StorageServiceImpl.java │ │ │ │ └── within │ │ │ │ ├── PointcutContainer.java │ │ │ │ ├── RepoAdvice.java │ │ │ │ └── WithinConfig.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── aop │ │ │ ├── PersonMonitorTest.java │ │ │ ├── StorageMonitorTest.java │ │ │ ├── test │ │ │ └── TestDbConfig.java │ │ │ └── within │ │ │ └── WithinDesignatorTest.java │ │ └── resources │ │ ├── db │ │ ├── schema.sql │ │ └── test-data.sql │ │ └── logback-test.xml ├── boot-aop │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── boot │ │ │ │ ├── Application.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── aop │ │ │ │ └── PersonMonitor.java │ │ │ │ ├── entities │ │ │ │ └── Person.java │ │ │ │ ├── repos │ │ │ │ └── PersonRepo.java │ │ │ │ └── services │ │ │ │ ├── PersonService.java │ │ │ │ └── PersonServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── boot │ │ │ └── ApplicationTest.java │ │ └── resources │ │ ├── application.yml │ │ └── logback-test.xml └── chapter04.gradle ├── chapter05 ├── boot-jpa │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── boot │ │ │ │ ├── Application.java │ │ │ │ ├── dao │ │ │ │ │ ├── AbstractEntity.java │ │ │ │ │ ├── CriminalCase.java │ │ │ │ │ ├── Detective.java │ │ │ │ │ ├── Evidence.java │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── Storage.java │ │ │ │ │ └── TrackEntry.java │ │ │ │ ├── repos │ │ │ │ │ └── PersonRepo.java │ │ │ │ └── services │ │ │ │ │ ├── Initializer.java │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ ├── ex │ │ │ │ ├── ConfigurationException.java │ │ │ │ └── UnexpectedException.java │ │ │ │ └── util │ │ │ │ ├── CaseStatus.java │ │ │ │ ├── CaseType.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ ├── Rank.java │ │ │ │ └── TrackAction.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ └── logback.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── boot │ │ │ ├── ApplicationTest.java │ │ │ └── RepositoriesTest.java │ │ └── resources │ │ └── application.yml ├── boot-mongo │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── mongo │ │ │ ├── Application.java │ │ │ ├── dao │ │ │ └── Person.java │ │ │ ├── repos │ │ │ └── PersonRepo.java │ │ │ └── services │ │ │ ├── PersonService.java │ │ │ └── impl │ │ │ └── PersonServicesImpl.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── mongo │ │ │ └── PersonServiceTest.java │ │ └── resources │ │ └── application.yml ├── chapter05.gradle ├── data-jpa-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── dj │ │ │ │ ├── AppConfig.java │ │ │ │ ├── repos │ │ │ │ ├── CriminalCaseRepo.java │ │ │ │ ├── DetectiveRepo.java │ │ │ │ ├── EvidenceRepo.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── StorageRepo.java │ │ │ │ └── TrackEntryRepo.java │ │ │ │ └── services │ │ │ │ ├── Initializer.java │ │ │ │ ├── PersonService.java │ │ │ │ └── impl │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── dj │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── DataSourceConfig.java │ │ └── resources │ │ └── db │ │ └── db.properties ├── data-jpa │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── dj │ │ │ │ │ ├── OracleDataSourceConfig.java │ │ │ │ │ ├── ServiceConfig.java │ │ │ │ │ ├── problem │ │ │ │ │ └── InvalidCriteriaException.java │ │ │ │ │ ├── repos │ │ │ │ │ ├── CriminalCaseRepo.java │ │ │ │ │ ├── DetectiveRepo.java │ │ │ │ │ ├── EvidenceRepo.java │ │ │ │ │ ├── PersonRepo.java │ │ │ │ │ ├── StorageRepo.java │ │ │ │ │ └── TrackEntryRepo.java │ │ │ │ │ └── services │ │ │ │ │ ├── CriminalCaseService.java │ │ │ │ │ ├── DetectiveService.java │ │ │ │ │ ├── EvidenceService.java │ │ │ │ │ ├── Initializer.java │ │ │ │ │ ├── PersonService.java │ │ │ │ │ ├── StorageService.java │ │ │ │ │ ├── TrackEntryService.java │ │ │ │ │ ├── impl │ │ │ │ │ ├── CriminalCaseServiceImpl.java │ │ │ │ │ ├── DetectiveServiceImpl.java │ │ │ │ │ ├── EvidenceServiceImpl.java │ │ │ │ │ ├── PersonServiceImpl.java │ │ │ │ │ ├── StorageServiceImpl.java │ │ │ │ │ └── TrackEntryServiceImpl.java │ │ │ │ │ └── wrappers │ │ │ │ │ └── DetectiveWrapper.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── prod-database.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── dj │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── DataSourceConfig.java │ │ └── resources │ │ └── db │ │ └── db.properties ├── emf-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── emf │ │ │ │ ├── config │ │ │ │ └── AppConfig.java │ │ │ │ ├── repos │ │ │ │ └── JpaPersonRepo.java │ │ │ │ └── services │ │ │ │ ├── Initializer.java │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── emf │ │ │ ├── JpaPersonRepoTest.java │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── JpaDbConfig.java │ │ └── resources │ │ ├── db │ │ └── db.properties │ │ └── logback-test.xml ├── emf │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── emf │ │ │ │ ├── config │ │ │ │ └── AppConfig.java │ │ │ │ ├── repos │ │ │ │ └── JpaPersonRepo.java │ │ │ │ └── services │ │ │ │ ├── Initializer.java │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── emf │ │ │ ├── JpaPersonRepoTest.java │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── JpaDbConfig.java │ │ └── resources │ │ ├── db │ │ └── db.properties │ │ └── logback-test.xml ├── hibernate-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── hib │ │ │ │ ├── config │ │ │ │ └── AppConfig.java │ │ │ │ ├── repos │ │ │ │ └── HibernateRepo.java │ │ │ │ └── services │ │ │ │ ├── Initializer.java │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── hib │ │ │ ├── HibernateRepoTest.java │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── HibernateDbConfig.java │ │ └── resources │ │ ├── db │ │ └── db.properties │ │ └── logback-test.xml ├── hibernate │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── hib │ │ │ │ ├── config │ │ │ │ └── AppConfig.java │ │ │ │ ├── repos │ │ │ │ └── HibernateRepo.java │ │ │ │ └── services │ │ │ │ ├── Initializer.java │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── hib │ │ │ ├── HibernateRepoTest.java │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── HibernateDbConfig.java │ │ └── resources │ │ ├── db │ │ └── db.properties │ │ └── logback-test.xml ├── jdbc-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── jdbc │ │ │ │ │ ├── JdbcConfig.java │ │ │ │ │ └── repos │ │ │ │ │ ├── AgnosticRepo.java │ │ │ │ │ ├── ExtraJdbcDetectiveRepo.java │ │ │ │ │ ├── ExtraJdbcPersonRepo.java │ │ │ │ │ ├── JdbcAgnosticRepo.java │ │ │ │ │ └── NamedParameterJdbcPersonRepo.java │ │ │ └── module-info.java │ │ └── resources │ │ │ ├── connection.properties │ │ │ └── logback.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── jdbc │ │ │ ├── JdbcAgnosticRepoTest.java │ │ │ ├── JdbcDetectiveRepoTest.java │ │ │ ├── JdbcPersonRepoTest.java │ │ │ ├── NamedParameterJdbcPersonRepoTest.java │ │ │ └── config │ │ │ ├── TestDbConfig.java │ │ │ └── TestDbConfig2.java │ │ └── resources │ │ ├── db │ │ ├── connection.properties │ │ ├── schema.sql │ │ └── test-data.sql │ │ └── logback-test.xml ├── jdbc │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── jdbc │ │ │ │ │ ├── JdbcConfig.java │ │ │ │ │ └── repos │ │ │ │ │ ├── AgnosticRepo.java │ │ │ │ │ ├── ExtraJdbcDetectiveRepo.java │ │ │ │ │ ├── ExtraJdbcPersonRepo.java │ │ │ │ │ ├── JdbcAgnosticRepo.java │ │ │ │ │ └── NamedParameterJdbcPersonRepo.java │ │ │ └── module-info.java │ │ └── resources │ │ │ ├── connection.properties │ │ │ └── logback.xml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── jdbc │ │ │ ├── JdbcAgnosticRepoTest.java │ │ │ ├── JdbcDetectiveRepoTest.java │ │ │ ├── JdbcPersonRepoTest.java │ │ │ ├── NamedParameterJdbcPersonRepoTest.java │ │ │ └── config │ │ │ ├── TestDbConfig.java │ │ │ └── TestDbConfig2.java │ │ └── resources │ │ ├── db │ │ ├── connection.properties │ │ ├── schema.sql │ │ └── test-data.sql │ │ └── logback-test.xml ├── mongo-simple │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── mongo │ │ │ │ ├── dao │ │ │ │ └── Person.java │ │ │ │ ├── repos │ │ │ │ └── PersonRepo.java │ │ │ │ └── services │ │ │ │ ├── PersonService.java │ │ │ │ └── impl │ │ │ │ └── PersonServicesImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── mongo │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── AppConfig.java │ │ └── resources │ │ ├── logback-test.xml │ │ └── mongo.properties ├── mongo-transactions │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── mongo │ │ │ │ ├── dao │ │ │ │ └── Person.java │ │ │ │ ├── repos │ │ │ │ └── PersonRepo.java │ │ │ │ └── services │ │ │ │ ├── PersonService.java │ │ │ │ └── impl │ │ │ │ └── PersonServicesImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── mongo │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── AppConfig.java │ │ └── resources │ │ ├── logback-test.xml │ │ └── mongo.properties ├── sandbox │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── dj │ │ │ │ └── sandbox │ │ │ │ └── repos │ │ │ │ ├── AppConfig.java │ │ │ │ ├── DetectiveRepo.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── StorageRepo.java │ │ │ │ └── cc │ │ │ │ ├── CriminalCaseRepo.java │ │ │ │ ├── CustomizedCriminalCaseRepo.java │ │ │ │ └── CustomizedCriminalCaseRepoImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── dj │ │ │ └── sandbox │ │ │ ├── CriminalCaseRepoTest.java │ │ │ ├── DetectiveRepoTest.java │ │ │ ├── PersonRepoTest.java │ │ │ ├── StorageRepoTest.java │ │ │ └── config │ │ │ └── JpaConfig.java │ │ └── resources │ │ ├── db │ │ └── db.properties │ │ └── logback-test.xml ├── sec-data-jpa │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── dj │ │ │ │ │ ├── OracleDataSourceConfig.java │ │ │ │ │ ├── ServiceConfig.java │ │ │ │ │ ├── problem │ │ │ │ │ └── InvalidCriteriaException.java │ │ │ │ │ ├── repos │ │ │ │ │ ├── CriminalCaseRepo.java │ │ │ │ │ ├── DetectiveRepo.java │ │ │ │ │ ├── EvidenceRepo.java │ │ │ │ │ ├── PersonRepo.java │ │ │ │ │ ├── StorageRepo.java │ │ │ │ │ └── TrackEntryRepo.java │ │ │ │ │ └── services │ │ │ │ │ ├── CriminalCaseService.java │ │ │ │ │ ├── DetectiveService.java │ │ │ │ │ ├── EvidenceService.java │ │ │ │ │ ├── Initializer.java │ │ │ │ │ ├── PersonService.java │ │ │ │ │ ├── StorageService.java │ │ │ │ │ ├── TrackEntryService.java │ │ │ │ │ ├── impl │ │ │ │ │ ├── CriminalCaseServiceImpl.java │ │ │ │ │ ├── DetectiveServiceImpl.java │ │ │ │ │ ├── EvidenceServiceImpl.java │ │ │ │ │ ├── PersonServiceImpl.java │ │ │ │ │ ├── StorageServiceImpl.java │ │ │ │ │ └── TrackEntryServiceImpl.java │ │ │ │ │ └── wrappers │ │ │ │ │ └── DetectiveWrapper.java │ │ │ └── module-info.java │ │ └── resources │ │ │ └── prod-database.properties │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── dj │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── DataSourceConfig.java │ │ └── resources │ │ └── db │ │ └── db.properties ├── transactions-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── tx │ │ │ │ ├── config │ │ │ │ └── AppConfig.java │ │ │ │ └── services │ │ │ │ └── PersonServiceImpl.java │ │ │ └── module-info.java │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── tx │ │ │ ├── PersonServiceTest.java │ │ │ └── config │ │ │ └── TestTransactionalDbConfig.java │ │ └── resources │ │ ├── db │ │ ├── connection.properties │ │ ├── schema.sql │ │ └── test-data.sql │ │ ├── logback-test.xml │ │ └── test │ │ ├── delete-test-data.sql │ │ └── extra-data.sql └── transactions │ ├── build.gradle │ └── src │ ├── main │ └── java │ │ ├── com │ │ └── apress │ │ │ └── cems │ │ │ └── tx │ │ │ ├── config │ │ │ └── AppConfig.java │ │ │ └── services │ │ │ ├── DetectiveServiceImpl.java │ │ │ ├── PersonServiceImpl.java │ │ │ ├── ProgramaticDetectiveService.java │ │ │ └── StorageServiceImpl.java │ │ └── module-info.java │ └── test │ ├── java │ └── com │ │ └── apress │ │ └── cems │ │ └── tx │ │ ├── DetectiveServiceTest.java │ │ ├── PersonRepoTest.java │ │ ├── PersonServiceTest.java │ │ ├── ProgramaticDetectiveServiceTest.java │ │ ├── config │ │ ├── TestTransactionalDbConfig.java │ │ └── TestTransactionalDbConfig2.java │ │ ├── one │ │ ├── MultipleTMsTest.java │ │ ├── MultipleTransactionManagersConfig.java │ │ ├── OneTransactionalService.java │ │ └── package-info.java │ │ ├── three │ │ ├── MultipleTMsTest.java │ │ ├── MultipleTransactionManagersConfig.java │ │ ├── ThreeTransactionalService.java │ │ └── package-info.java │ │ └── two │ │ ├── MultipleTMsTest.java │ │ ├── MultipleTransactionManagersConfig.java │ │ ├── TwoTransactionalService.java │ │ └── package-info.java │ └── resources │ ├── db │ ├── connection.properties │ ├── schema.sql │ └── test-data.sql │ ├── logback-test.xml │ └── test │ ├── delete-test-data.sql │ └── extra-data.sql ├── chapter06 ├── boot-web-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── practice │ │ │ │ ├── HomeController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── MissingRecordsHandler.java │ │ │ │ ├── SpringBootWebApplication.java │ │ │ │ ├── WebConfig.java │ │ │ │ ├── ex │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── MultiplePersonController.java │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── SinglePersonController.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ ├── i18n │ │ │ ├── global.properties │ │ │ └── global_de.properties │ │ │ ├── static │ │ │ ├── images │ │ │ │ ├── arrow-blue.png │ │ │ │ ├── arrow-green.png │ │ │ │ ├── banner-blue.png │ │ │ │ ├── banner-green.png │ │ │ │ └── favicon.ico │ │ │ └── styles │ │ │ │ ├── decorator-blue.css │ │ │ │ ├── decorator-green.css │ │ │ │ └── general.css │ │ │ └── templates │ │ │ ├── error.html │ │ │ ├── fragments │ │ │ └── layout.html │ │ │ ├── home.html │ │ │ └── persons │ │ │ ├── edit.html │ │ │ ├── list.html │ │ │ ├── search.html │ │ │ └── show.html │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── practice │ │ │ └── boot │ │ │ ├── SpringBootWebApplication3Test.java │ │ │ └── SpringBootWebApplicationTest.java │ │ └── resources │ │ └── application.yml ├── boot-web │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── HomeController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── MissingRecordsHandler.java │ │ │ │ ├── SpringBootWebApplication.java │ │ │ │ ├── WebConfig.java │ │ │ │ ├── ex │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── MultiplePersonController.java │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── SinglePersonController.java │ │ │ │ ├── SinglePersonController2.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ ├── i18n │ │ │ ├── global_de.properties │ │ │ └── global_en.properties │ │ │ ├── static │ │ │ ├── images │ │ │ │ ├── arrow-blue.png │ │ │ │ ├── arrow-green.png │ │ │ │ ├── banner-blue.png │ │ │ │ ├── banner-green.png │ │ │ │ └── favicon.ico │ │ │ └── styles │ │ │ │ ├── decorator-blue.css │ │ │ │ ├── decorator-green.css │ │ │ │ └── general.css │ │ │ └── templates │ │ │ ├── error.html │ │ │ ├── fragments │ │ │ └── layout.html │ │ │ ├── home.html │ │ │ └── persons │ │ │ ├── edit.html │ │ │ ├── list.html │ │ │ ├── search.html │ │ │ └── show.html │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── boot │ │ │ ├── SpringBootWebApplicationTest.java │ │ │ └── two │ │ │ ├── SpringBootWebApplication3Test.java │ │ │ └── SpringBootWebApplicationTest.java │ │ └── resources │ │ └── application.yml ├── chapter06.gradle ├── mvc-basic-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── web │ │ │ │ │ ├── config │ │ │ │ │ ├── H2DbConfig.java │ │ │ │ │ ├── WebConfig.java │ │ │ │ │ └── WebInitializer.java │ │ │ │ │ ├── controllers │ │ │ │ │ ├── DetectiveController.java │ │ │ │ │ ├── HomeController.java │ │ │ │ │ └── PersonController.java │ │ │ │ │ └── problem │ │ │ │ │ └── NotFoundException.java │ │ │ └── module-info.java │ │ ├── resources │ │ │ ├── db.properties │ │ │ └── logback.xml │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── classes │ │ │ │ ├── blue.properties │ │ │ │ └── green.properties │ │ │ ├── detectives │ │ │ │ ├── list.jsp │ │ │ │ └── show.jsp │ │ │ ├── error.jsp │ │ │ ├── home.jsp │ │ │ ├── messages │ │ │ │ ├── global_de.properties │ │ │ │ └── global_en.properties │ │ │ └── persons │ │ │ │ ├── list.jsp │ │ │ │ └── show.jsp │ │ │ ├── images │ │ │ ├── arrow-blue.png │ │ │ ├── arrow-green.png │ │ │ ├── banner-blue.png │ │ │ └── banner-green.png │ │ │ └── styles │ │ │ ├── decorator-blue.css │ │ │ ├── decorator-green.css │ │ │ └── general.css │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── web │ │ └── controllers │ │ └── PersonControllerTest.java ├── mvc-basic-xml │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── web │ │ │ │ │ ├── config │ │ │ │ │ ├── H2DbConfig.java │ │ │ │ │ └── WebInitializer.java │ │ │ │ │ ├── controllers │ │ │ │ │ ├── DetectiveController.java │ │ │ │ │ ├── HomeController.java │ │ │ │ │ └── PersonController.java │ │ │ │ │ └── problem │ │ │ │ │ ├── NotFoundException.java │ │ │ │ │ └── WebException.java │ │ │ └── module-info.java │ │ ├── resources │ │ │ ├── db.properties │ │ │ └── logback.xml │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── classes │ │ │ │ ├── blue.properties │ │ │ │ └── green.properties │ │ │ ├── detectives │ │ │ │ ├── list.jsp │ │ │ │ └── show.jsp │ │ │ ├── error.jsp │ │ │ ├── home │ │ │ │ ├── hello.jsp │ │ │ │ ├── root.jsp │ │ │ │ ├── sandbox.jsp │ │ │ │ └── today.jsp │ │ │ ├── index.jsp │ │ │ ├── messages │ │ │ │ ├── global_de.properties │ │ │ │ └── global_en.properties │ │ │ ├── persons │ │ │ │ ├── list.jsp │ │ │ │ └── show.jsp │ │ │ └── spring │ │ │ │ ├── mvc-config.xml │ │ │ │ └── spring-app.xml │ │ │ ├── images │ │ │ ├── arrow-blue.png │ │ │ ├── arrow-green.png │ │ │ ├── banner-blue.png │ │ │ └── banner-green.png │ │ │ └── styles │ │ │ ├── decorator-blue.css │ │ │ ├── decorator-green.css │ │ │ └── general.css │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── web │ │ └── controllers │ │ └── PersonControllerTest.java ├── mvc-basic │ ├── README.adoc │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── web │ │ │ │ │ ├── config │ │ │ │ │ ├── H2DbConfig.java │ │ │ │ │ ├── WebConfig.java │ │ │ │ │ └── WebInitializer.java │ │ │ │ │ ├── controllers │ │ │ │ │ ├── BeansController.java │ │ │ │ │ ├── DetectiveController.java │ │ │ │ │ ├── HomeController.java │ │ │ │ │ └── PersonController.java │ │ │ │ │ └── problem │ │ │ │ │ ├── MissingExceptionResolver.java │ │ │ │ │ ├── MissingRecordsHandler.java │ │ │ │ │ └── NotFoundException.java │ │ │ └── module-info.java │ │ ├── resources │ │ │ ├── db.properties │ │ │ └── logback.xml │ │ └── webapp │ │ │ ├── WEB-INF │ │ │ ├── classes │ │ │ │ ├── blue.properties │ │ │ │ └── green.properties │ │ │ ├── detectives │ │ │ │ ├── list.jsp │ │ │ │ └── show.jsp │ │ │ ├── error.jsp │ │ │ ├── home.jsp │ │ │ ├── home │ │ │ │ ├── hello.jsp │ │ │ │ ├── root.jsp │ │ │ │ └── today.jsp │ │ │ ├── messages │ │ │ │ ├── global_de.properties │ │ │ │ └── global_en.properties │ │ │ ├── persons │ │ │ │ ├── list.jsp │ │ │ │ └── show.jsp │ │ │ └── sandbox.jsp │ │ │ ├── images │ │ │ ├── arrow-blue.png │ │ │ ├── arrow-green.png │ │ │ ├── banner-blue.png │ │ │ ├── banner-green.png │ │ │ └── favicon.ico │ │ │ └── styles │ │ │ ├── decorator-blue.css │ │ │ ├── decorator-green.css │ │ │ └── general.css │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── web │ │ └── controllers │ │ └── PersonControllerTest.java ├── mvc-thymeleaf │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── web │ │ │ │ ├── config │ │ │ │ ├── H2DbConfig.java │ │ │ │ ├── WebConfig.java │ │ │ │ └── WebInitializer.java │ │ │ │ ├── controllers │ │ │ │ ├── DetectiveController.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── MultiplePersonController.java │ │ │ │ └── SinglePersonController.java │ │ │ │ ├── problem │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── NotFoundException.java │ │ │ │ └── resolver │ │ │ │ └── JsonViewResolver.java │ │ └── module-info.java │ │ ├── resources │ │ ├── db.properties │ │ ├── i18n │ │ │ ├── global.properties │ │ │ └── global_de.properties │ │ └── logback.xml │ │ └── webapp │ │ └── WEB-INF │ │ ├── classes │ │ ├── blue.properties │ │ └── green.properties │ │ ├── detectives │ │ ├── list.html │ │ └── show.html │ │ ├── error.html │ │ ├── home.html │ │ ├── images │ │ ├── arrow-blue.png │ │ ├── arrow-green.png │ │ ├── banner-blue.png │ │ ├── banner-green.png │ │ └── favicon.ico │ │ ├── persons │ │ ├── edit.html │ │ ├── list.html │ │ ├── search.html │ │ └── show.html │ │ ├── styles │ │ ├── decorator-blue.css │ │ ├── decorator-green.css │ │ └── general.css │ │ └── templates │ │ └── layout.html └── mvc-views │ ├── build.gradle │ └── src │ └── main │ ├── java │ ├── com │ │ └── apress │ │ │ └── cems │ │ │ └── web │ │ │ ├── config │ │ │ ├── H2DbConfig.java │ │ │ ├── WebConfig.java │ │ │ └── WebInitializer.java │ │ │ ├── controllers │ │ │ ├── DetectiveController.java │ │ │ ├── HomeController.java │ │ │ ├── MultiplePersonController.java │ │ │ └── SinglePersonController.java │ │ │ ├── problem │ │ │ └── NotFoundException.java │ │ │ ├── resolver │ │ │ └── JsonViewResolver.java │ │ │ ├── util │ │ │ └── Properties.java │ │ │ └── views │ │ │ ├── AbstractPdfView.java │ │ │ ├── PersonExcelView.java │ │ │ └── PersonPdfView.java │ └── module-info.java │ ├── resources │ ├── db.properties │ ├── i18n │ │ ├── global.properties │ │ └── global_de.properties │ └── logback.xml │ └── webapp │ └── WEB-INF │ ├── classes │ ├── blue.properties │ └── green.properties │ ├── detectives │ ├── list.html │ └── show.html │ ├── home.html │ ├── images │ ├── arrow-blue.png │ ├── arrow-green.png │ ├── banner-blue.png │ ├── banner-green.png │ └── favicon.ico │ ├── persons │ ├── edit.html │ ├── list.html │ ├── search.html │ └── show.html │ ├── styles │ ├── decorator-blue.css │ ├── decorator-green.css │ └── general.css │ └── templates │ └── layout.html ├── chapter07 ├── boot-sec │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── BootSecureApp.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── MissingRecordsHandler.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── WebConfig.java │ │ │ │ ├── ex │ │ │ │ ├── ConfigurationException.java │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── MultiplePersonController.java │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── SinglePersonController.java │ │ │ │ └── services │ │ │ │ │ ├── PersonAudit.java │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ ├── i18n │ │ │ ├── global.properties │ │ │ └── global_de.properties │ │ │ ├── static │ │ │ ├── images │ │ │ │ ├── arrow-blue.png │ │ │ │ ├── arrow-green.png │ │ │ │ ├── banner-blue.png │ │ │ │ ├── banner-green.png │ │ │ │ └── favicon.ico │ │ │ └── styles │ │ │ │ ├── decorator-blue.css │ │ │ │ ├── decorator-green.css │ │ │ │ └── general.css │ │ │ └── templates │ │ │ ├── error.html │ │ │ ├── fragments │ │ │ └── layout.html │ │ │ ├── home.html │ │ │ └── persons │ │ │ ├── edit.html │ │ │ ├── list.html │ │ │ ├── search.html │ │ │ └── show.html │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ ├── BootSecureAppMock2Test.java │ │ ├── BootSecureAppMockTest.java │ │ └── BootSecureAppTest.java ├── chapter07.gradle ├── mvc-sec-practice │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── sec │ │ │ │ ├── config │ │ │ │ ├── H2DbConfig.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── SecurityInitializer.java │ │ │ │ ├── WebConfig.java │ │ │ │ └── WebInitializer.java │ │ │ │ ├── controllers │ │ │ │ ├── DetectiveController.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── MultiplePersonController.java │ │ │ │ └── SinglePersonController.java │ │ │ │ ├── problem │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── resolver │ │ │ │ └── JsonViewResolver.java │ │ │ │ └── util │ │ │ │ └── CurrentUser.java │ │ └── module-info.java │ │ ├── resources │ │ ├── db.properties │ │ ├── i18n │ │ │ ├── global_de.properties │ │ │ └── global_en.properties │ │ └── logback.xml │ │ └── webapp │ │ └── WEB-INF │ │ ├── classes │ │ ├── blue.properties │ │ └── green.properties │ │ ├── detectives │ │ ├── list.html │ │ └── show.html │ │ ├── error.html │ │ ├── home.html │ │ ├── images │ │ ├── arrow-blue.png │ │ ├── arrow-green.png │ │ ├── banner-blue.png │ │ ├── banner-green.png │ │ └── favicon.ico │ │ ├── persons │ │ ├── edit.html │ │ ├── list.html │ │ ├── search.html │ │ └── show.html │ │ ├── styles │ │ ├── decorator-blue.css │ │ ├── decorator-green.css │ │ └── general.css │ │ └── templates │ │ └── layout.html ├── mvc-sec-thymeleaf │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── sec │ │ │ │ ├── config │ │ │ │ ├── H2DbConfig.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── SecurityInitializer.java │ │ │ │ ├── WebConfig.java │ │ │ │ └── WebInitializer.java │ │ │ │ ├── controllers │ │ │ │ ├── DetectiveController.java │ │ │ │ ├── HomeController.java │ │ │ │ ├── MultiplePersonController.java │ │ │ │ └── SinglePersonController.java │ │ │ │ ├── problem │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── resolver │ │ │ │ └── JsonViewResolver.java │ │ │ │ └── util │ │ │ │ └── CurrentUser.java │ │ └── module-info.java │ │ ├── resources │ │ ├── db.properties │ │ ├── i18n │ │ │ ├── global_de.properties │ │ │ └── global_en.properties │ │ └── logback.xml │ │ └── webapp │ │ └── WEB-INF │ │ ├── classes │ │ ├── blue.properties │ │ └── green.properties │ │ ├── detectives │ │ ├── list.html │ │ └── show.html │ │ ├── error.html │ │ ├── home.html │ │ ├── images │ │ ├── arrow-blue.png │ │ ├── arrow-green.png │ │ ├── banner-blue.png │ │ ├── banner-green.png │ │ └── favicon.ico │ │ ├── persons │ │ ├── edit.html │ │ ├── list.html │ │ ├── search.html │ │ └── show.html │ │ ├── styles │ │ ├── decorator-blue.css │ │ ├── decorator-green.css │ │ └── general.css │ │ └── templates │ │ └── layout.html ├── mvc-sec-xml │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── sec │ │ │ │ ├── config │ │ │ │ ├── H2DbConfig.java │ │ │ │ └── WebInitializer.java │ │ │ │ ├── controllers │ │ │ │ ├── DetectiveController.java │ │ │ │ ├── HomeController.java │ │ │ │ └── PersonController.java │ │ │ │ └── problem │ │ │ │ ├── NotFoundException.java │ │ │ │ └── WebException.java │ │ └── module-info.java │ │ ├── resources │ │ ├── db.properties │ │ └── logback.xml │ │ └── webapp │ │ ├── WEB-INF │ │ ├── auth.jsp │ │ ├── classes │ │ │ ├── blue.properties │ │ │ └── green.properties │ │ ├── detectives │ │ │ ├── list.jsp │ │ │ └── show.jsp │ │ ├── error.jsp │ │ ├── home │ │ │ ├── hello.jsp │ │ │ ├── root.jsp │ │ │ ├── sandbox.jsp │ │ │ └── today.jsp │ │ ├── index.jsp │ │ ├── messages │ │ │ ├── global_de.properties │ │ │ └── global_en.properties │ │ ├── persons │ │ │ ├── list.jsp │ │ │ ├── newPerson.jsp │ │ │ └── show.jsp │ │ └── spring │ │ │ ├── mvc-config.xml │ │ │ ├── security-config.xml │ │ │ └── spring-app.xml │ │ ├── images │ │ ├── arrow-blue.png │ │ ├── arrow-green.png │ │ ├── banner-blue.png │ │ └── banner-green.png │ │ └── styles │ │ ├── decorator-blue.css │ │ ├── decorator-green.css │ │ └── general.css └── mvc-sec │ ├── build.gradle │ └── src │ ├── main │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── sec │ │ │ │ ├── config │ │ │ │ ├── H2DbConfig.java │ │ │ │ ├── SecurityConfig.java │ │ │ │ ├── SecurityConfig2.java │ │ │ │ ├── SecurityInitializer.java │ │ │ │ ├── WebConfig.java │ │ │ │ └── WebInitializer.java │ │ │ │ ├── controllers │ │ │ │ ├── BeansController.java │ │ │ │ ├── DetectiveController.java │ │ │ │ ├── HomeController.java │ │ │ │ └── PersonController.java │ │ │ │ └── problem │ │ │ │ ├── MissingExceptionResolver.java │ │ │ │ ├── MissingRecordsHandler.java │ │ │ │ └── NotFoundException.java │ │ └── module-info.java │ ├── resources │ │ ├── db.properties │ │ └── logback.xml │ └── webapp │ │ ├── WEB-INF │ │ ├── accessDenied.jsp │ │ ├── auth.jsp │ │ ├── classes │ │ │ ├── blue.properties │ │ │ └── green.properties │ │ ├── detectives │ │ │ ├── list.jsp │ │ │ └── show.jsp │ │ ├── error.jsp │ │ ├── home.jsp │ │ ├── home │ │ │ ├── hello.jsp │ │ │ ├── root.jsp │ │ │ └── today.jsp │ │ ├── messages │ │ │ ├── global_de.properties │ │ │ └── global_en.properties │ │ └── persons │ │ │ ├── list.jsp │ │ │ ├── newPerson.jsp │ │ │ └── show.jsp │ │ ├── images │ │ ├── arrow-blue.png │ │ ├── arrow-green.png │ │ ├── banner-blue.png │ │ ├── banner-green.png │ │ └── favicon.ico │ │ └── styles │ │ ├── decorator-blue.css │ │ ├── decorator-green.css │ │ └── general.css │ └── test │ └── java │ └── com │ └── apress │ └── cems │ └── sec │ └── controllers │ └── PersonControllerTest.java ├── chapter08 ├── 00Pivotal_Spring_Exam.postman_collection.json ├── boot-rest-jetty │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── BeansController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── JsonError.java │ │ │ │ ├── RestApplication.java │ │ │ │ ├── RestExceptionsHandler.java │ │ │ │ ├── base │ │ │ │ └── AbstractEntity.java │ │ │ │ ├── ex │ │ │ │ ├── CreationException.java │ │ │ │ ├── IllegalOperation.java │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── BetterPersonsController.java │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── PersonsController.java │ │ │ │ ├── PersonsException.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── banner.txt │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── RestAssuredTest.java │ │ │ └── RestTemplateTest.java │ │ └── resources │ │ └── application.yml ├── boot-rest-practice │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── practice │ │ │ │ ├── BeansController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── PracticeRestApplication.java │ │ │ │ ├── RestExceptionsHandler.java │ │ │ │ ├── base │ │ │ │ └── AbstractEntity.java │ │ │ │ ├── ex │ │ │ │ ├── CreationException.java │ │ │ │ ├── IllegalOperation.java │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── PersonsController.java │ │ │ │ ├── PersonsException.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── banner.txt │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── practice │ │ │ └── PersonsControllerTest.java │ │ └── resources │ │ └── application.yml ├── boot-rest-secured │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── secured │ │ │ │ ├── BeansController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── RestExceptionsHandler.java │ │ │ │ ├── SecuredRestApplication.java │ │ │ │ ├── base │ │ │ │ └── AbstractEntity.java │ │ │ │ ├── config │ │ │ │ ├── RestAuthenticationSuccessHandler.java │ │ │ │ └── SecurityConfig.java │ │ │ │ ├── ex │ │ │ │ ├── CreationException.java │ │ │ │ ├── IllegalOperation.java │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── package-info.java │ │ │ │ ├── person │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── PersonsController.java │ │ │ │ ├── PersonsException.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ ├── keystore.jks │ │ │ └── rest.crt │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── secured │ │ │ └── SecuredRestApplicationTest.java │ │ └── resources │ │ └── application.yml ├── boot-rest │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── BeansController.java │ │ │ │ ├── Initializer.java │ │ │ │ ├── RestApplication.java │ │ │ │ ├── RestExceptionsHandler.java │ │ │ │ ├── base │ │ │ │ └── AbstractEntity.java │ │ │ │ ├── ex │ │ │ │ ├── CreationException.java │ │ │ │ ├── IllegalOperation.java │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── PersonsController.java │ │ │ │ ├── PersonsException.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── banner.txt │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── PersonsControllerTest.java │ │ └── resources │ │ └── application.yml ├── chapter08.gradle ├── rest-classic-secured │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ └── rest │ │ │ │ │ └── sec │ │ │ │ │ ├── config │ │ │ │ │ ├── H2DbConfig.java │ │ │ │ │ ├── RestAuthenticationSuccessHandler.java │ │ │ │ │ ├── SecurityConfig.java │ │ │ │ │ ├── SecurityInitializer.java │ │ │ │ │ └── WebConfig.java │ │ │ │ │ ├── controllers │ │ │ │ │ ├── BeansController.java │ │ │ │ │ └── PersonsController.java │ │ │ │ │ └── problem │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ ├── IllegalOperation.java │ │ │ │ │ └── NotFoundException.java │ │ │ └── module-info.java │ │ └── resources │ │ │ ├── db.properties │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── sec │ │ └── RestAssuredSecuredTest.java └── rest-classic │ ├── build.gradle │ └── src │ ├── main │ ├── java │ │ ├── com │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── rest │ │ │ │ ├── config │ │ │ │ ├── H2DbConfig.java │ │ │ │ └── WebConfig.java │ │ │ │ ├── controllers │ │ │ │ ├── BeansController.java │ │ │ │ └── PersonsController.java │ │ │ │ └── problem │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── IllegalOperation.java │ │ │ │ └── NotFoundException.java │ │ └── module-info.java │ └── resources │ │ ├── db.properties │ │ └── logback.xml │ └── test │ └── java │ └── com │ └── apress │ └── cems │ └── RestAssuredTest.java ├── chapter09 ├── 00Pivotal_Spring_Exam.postman_collection.json ├── boot-app │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── Initializer.java │ │ │ │ ├── RestApplication.java │ │ │ │ ├── base │ │ │ │ └── AbstractEntity.java │ │ │ │ ├── detective │ │ │ │ ├── Detective.java │ │ │ │ ├── DetectiveRepo.java │ │ │ │ ├── DetectivesController.java │ │ │ │ ├── DetectivesException.java │ │ │ │ └── services │ │ │ │ │ ├── DetectiveService.java │ │ │ │ │ └── DetectiveServiceImpl.java │ │ │ │ ├── ex │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── mine │ │ │ │ └── HealthChecker.java │ │ │ │ ├── person │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── PersonsController.java │ │ │ │ ├── PersonsException.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application-all.yml │ │ │ ├── application-none.yml │ │ │ ├── application-prometheus.yml │ │ │ ├── application-some.yml │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ └── prometheus.yml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ ├── RestApplicationFourTest.java │ │ │ ├── RestApplicationOneTest.java │ │ │ ├── RestApplicationPrometheusTest.java │ │ │ ├── RestApplicationThreeTest.java │ │ │ └── RestApplicationTwoTest.java │ │ └── resources │ │ ├── application-four.yml │ │ ├── application-one.yml │ │ ├── application-three.yml │ │ └── application-two.yml ├── chapter09.gradle ├── classic-app │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ ├── com │ │ │ │ └── apress │ │ │ │ │ └── cems │ │ │ │ │ ├── BeansController.java │ │ │ │ │ ├── HealthController.java │ │ │ │ │ ├── Initializer.java │ │ │ │ │ ├── base │ │ │ │ │ └── AbstractEntity.java │ │ │ │ │ ├── config │ │ │ │ │ ├── RootConfig.java │ │ │ │ │ └── WebConfig.java │ │ │ │ │ ├── detective │ │ │ │ │ ├── Detective.java │ │ │ │ │ ├── DetectiveRepo.java │ │ │ │ │ ├── DetectivesController.java │ │ │ │ │ ├── DetectivesException.java │ │ │ │ │ └── services │ │ │ │ │ │ ├── DetectiveService.java │ │ │ │ │ │ └── DetectiveServiceImpl.java │ │ │ │ │ ├── ex │ │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ │ └── NotFoundException.java │ │ │ │ │ ├── person │ │ │ │ │ ├── Person.java │ │ │ │ │ ├── PersonRepo.java │ │ │ │ │ ├── PersonsController.java │ │ │ │ │ ├── PersonsException.java │ │ │ │ │ └── services │ │ │ │ │ │ ├── PersonService.java │ │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ │ └── util │ │ │ │ │ ├── CriteriaDto.java │ │ │ │ │ ├── DateProcessor.java │ │ │ │ │ ├── EmploymentStatus.java │ │ │ │ │ ├── FieldGroup.java │ │ │ │ │ ├── NumberGenerator.java │ │ │ │ │ └── Rank.java │ │ │ └── module-info.java │ │ └── resources │ │ │ ├── db.properties │ │ │ └── logback.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── PersonsControllerTest.java ├── prometheus-boot-app │ ├── README.adoc │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ ├── Initializer.java │ │ │ │ ├── PrometheusApplication.java │ │ │ │ ├── base │ │ │ │ └── AbstractEntity.java │ │ │ │ ├── detective │ │ │ │ ├── Detective.java │ │ │ │ ├── DetectiveRepo.java │ │ │ │ ├── DetectivesController.java │ │ │ │ ├── DetectivesException.java │ │ │ │ └── services │ │ │ │ │ ├── DetectiveService.java │ │ │ │ │ └── DetectiveServiceImpl.java │ │ │ │ ├── ex │ │ │ │ ├── InvalidCriteriaException.java │ │ │ │ └── NotFoundException.java │ │ │ │ ├── person │ │ │ │ ├── Person.java │ │ │ │ ├── PersonRepo.java │ │ │ │ ├── PersonsController.java │ │ │ │ ├── PersonsException.java │ │ │ │ └── services │ │ │ │ │ ├── PersonService.java │ │ │ │ │ └── PersonServiceImpl.java │ │ │ │ └── util │ │ │ │ ├── CriteriaDto.java │ │ │ │ ├── DateProcessor.java │ │ │ │ ├── EmploymentStatus.java │ │ │ │ ├── FieldGroup.java │ │ │ │ ├── NumberGenerator.java │ │ │ │ └── Rank.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── banner.txt │ │ │ └── prometheus.yml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── PersonsControllerTest.java │ │ └── resources │ │ ├── application-four.yml │ │ ├── application-one.yml │ │ ├── application-three.yml │ │ └── application-two.yml └── secured-boot-app │ ├── build.gradle │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── sec │ │ │ ├── Initializer.java │ │ │ ├── SecuredRestApplication.java │ │ │ ├── base │ │ │ └── AbstractEntity.java │ │ │ ├── config │ │ │ ├── RestAuthenticationSuccessHandler.java │ │ │ └── SecurityConfig.java │ │ │ ├── detective │ │ │ ├── Detective.java │ │ │ ├── DetectiveRepo.java │ │ │ ├── DetectivesController.java │ │ │ ├── DetectivesException.java │ │ │ └── services │ │ │ │ ├── DetectiveService.java │ │ │ │ └── DetectiveServiceImpl.java │ │ │ ├── ex │ │ │ ├── InvalidCriteriaException.java │ │ │ └── NotFoundException.java │ │ │ ├── mine │ │ │ ├── DaoEndpoint.java │ │ │ └── DaoHealth.java │ │ │ ├── person │ │ │ ├── Person.java │ │ │ ├── PersonRepo.java │ │ │ ├── PersonsController.java │ │ │ ├── PersonsException.java │ │ │ └── services │ │ │ │ ├── PersonService.java │ │ │ │ └── PersonServiceImpl.java │ │ │ └── util │ │ │ ├── CriteriaDto.java │ │ │ ├── DateProcessor.java │ │ │ ├── EmploymentStatus.java │ │ │ ├── FieldGroup.java │ │ │ ├── NumberGenerator.java │ │ │ └── Rank.java │ └── resources │ │ ├── application.yml │ │ └── banner.txt │ └── test │ ├── java │ └── com │ │ └── apress │ │ └── cems │ │ └── sec │ │ └── SecuredRestApplicationTest.java │ └── resources │ └── application-one.yml ├── chapter10 ├── HELP.md ├── build.gradle.kts ├── settings.gradle.kts └── src │ ├── main │ ├── kotlin │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── kotlin │ │ │ ├── CriteriaDto.kt │ │ │ ├── Entities.kt │ │ │ ├── Initializer.kt │ │ │ ├── KotlinApplication.kt │ │ │ ├── Repositories.kt │ │ │ ├── Util.kt │ │ │ ├── WebConfig.kt │ │ │ └── WebControllers.kt │ └── resources │ │ ├── application.yml │ │ ├── banner.txt │ │ ├── i18n │ │ ├── global_de.properties │ │ └── global_en.properties │ │ ├── static │ │ ├── images │ │ │ ├── arrow-blue.png │ │ │ ├── arrow-green.png │ │ │ ├── banner-blue.png │ │ │ ├── banner-green.png │ │ │ └── favicon.ico │ │ └── styles │ │ │ ├── decorator-blue.css │ │ │ ├── decorator-green.css │ │ │ └── general.css │ │ └── templates │ │ ├── detectives │ │ ├── list.html │ │ └── show.html │ │ ├── error.html │ │ ├── fragments │ │ └── layout.html │ │ ├── home.html │ │ └── persons │ │ ├── list.html │ │ ├── search.html │ │ └── show.html │ └── test │ └── kotlin │ └── com │ └── apress │ └── cems │ └── kotlin │ ├── KotlinApplicationTests.kt │ ├── RepositoryTests.kt │ └── WebControllerTests.kt ├── chapter11 ├── chapter11.gradle ├── detectives-server │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── detective │ │ │ ├── DetectiveRepo.java │ │ │ ├── DetectivesController.java │ │ │ ├── DetectivesException.java │ │ │ ├── DetectivesServer.java │ │ │ └── services │ │ │ ├── DetectiveService.java │ │ │ ├── DetectiveServiceImpl.java │ │ │ └── Initializer.java │ │ └── resources │ │ ├── banner.txt │ │ └── detectives-server.yml ├── discovery-server │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── DiscoveryServer.java │ │ └── resources │ │ ├── banner.txt │ │ └── discovery-server.yml ├── entities │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ ├── com │ │ └── apress │ │ │ └── cems │ │ │ ├── base │ │ │ └── AbstractEntity.java │ │ │ ├── detective │ │ │ └── Detective.java │ │ │ ├── ex │ │ │ ├── InvalidCriteriaException.java │ │ │ └── NotFoundException.java │ │ │ ├── person │ │ │ └── Person.java │ │ │ └── util │ │ │ ├── CriteriaDto.java │ │ │ ├── DateProcessor.java │ │ │ ├── EmploymentStatus.java │ │ │ ├── FieldGroup.java │ │ │ ├── NumberGenerator.java │ │ │ └── Rank.java │ │ └── module-info.java ├── persons-server │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── cems │ │ │ └── person │ │ │ ├── PersonRepo.java │ │ │ ├── PersonsController.java │ │ │ ├── PersonsException.java │ │ │ ├── PersonsServer.java │ │ │ └── services │ │ │ ├── Initializer.java │ │ │ ├── PersonService.java │ │ │ └── PersonServiceImpl.java │ │ └── resources │ │ ├── banner.txt │ │ └── persons-server.yml └── web-client │ ├── build.gradle │ └── src │ └── main │ ├── java │ └── com │ │ └── apress │ │ └── cems │ │ └── web │ │ ├── AllWebController.java │ │ ├── AllWebServices.java │ │ ├── MissingRecordsHandler.java │ │ ├── WebClient.java │ │ └── WebConfig.java │ └── resources │ ├── banner.txt │ ├── i18n │ ├── global_de.properties │ └── global_en.properties │ ├── static │ ├── images │ │ ├── arrow-blue.png │ │ ├── arrow-green.png │ │ ├── banner-blue.png │ │ ├── banner-green.png │ │ └── favicon.ico │ └── styles │ │ ├── decorator-blue.css │ │ ├── decorator-green.css │ │ └── general.css │ ├── templates │ ├── detectives │ │ ├── list.html │ │ └── show.html │ ├── error.html │ ├── fragments │ │ └── layout.html │ ├── home.html │ └── persons │ │ ├── list.html │ │ ├── search.html │ │ └── show.html │ └── web-client.yml ├── chapter12 ├── chapter12.gradle ├── reactive-boot-hybrid │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── reactive │ │ │ │ ├── ReactiveHybridApplication.java │ │ │ │ └── person │ │ │ │ ├── Initializer.java │ │ │ │ ├── PersonController.java │ │ │ │ ├── PersonReactiveService.java │ │ │ │ ├── PersonReactiveServiceImpl.java │ │ │ │ └── PersonRepo.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── banner.txt │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── reactive │ │ ├── ExchangeFunctionTest.java │ │ └── ReactiveHybridTest.java ├── reactive-boot-kinda │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── reactive │ │ │ │ ├── ReactiveApplication.java │ │ │ │ └── person │ │ │ │ ├── Initializer.java │ │ │ │ ├── PersonHandler.java │ │ │ │ ├── PersonReactiveService.java │ │ │ │ ├── PersonReactiveServiceImpl.java │ │ │ │ └── PersonRepo.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── banner.txt │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── reactive │ │ └── PersonHandlerTest.java ├── reactive-boot-mongo │ ├── README.adoc │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── reactive │ │ │ │ ├── MongoReactiveApplication.java │ │ │ │ └── person │ │ │ │ ├── Initializer.java │ │ │ │ ├── Person.java │ │ │ │ ├── PersonHandler.java │ │ │ │ ├── PersonReactiveRepo.java │ │ │ │ └── services │ │ │ │ ├── PersonReactiveService.java │ │ │ │ └── PersonReactiveServiceImpl.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── apress │ │ │ └── reactive │ │ │ ├── MongoReactiveApplicationTests.java │ │ │ └── MongoReactiveServiceTest.java │ │ └── resources │ │ └── application.yml ├── reactive-boot-r2dbc │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── apress │ │ │ │ └── cems │ │ │ │ └── r2dbc │ │ │ │ ├── Initializer.java │ │ │ │ ├── ReactiveBootR2dbcApplication.java │ │ │ │ ├── ReactiveH2Config.java │ │ │ │ └── person │ │ │ │ ├── Person.java │ │ │ │ ├── PersonHandler.java │ │ │ │ ├── PersonRepo.java │ │ │ │ └── services │ │ │ │ ├── PersonService.java │ │ │ │ └── PersonServiceImpl.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── apress │ │ └── cems │ │ └── r2dbc │ │ ├── PersonRepoTests.java │ │ ├── PersonServiceTests.java │ │ ├── R2dbcApplicationTests.java │ │ └── TestBase.java └── reactive-sandbox │ ├── build.gradle │ └── src │ └── test │ └── java │ └── com │ └── apress │ └── reactive │ ├── FluxPlayTest.java │ ├── GenericSubscriber.java │ ├── MonoPlayTest.java │ └── SimpleSubscriber.java ├── cover.jpg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .gradle 3 | *.iml 4 | out 5 | build 6 | *.class 7 | .DS_Store 8 | 9 | # Mobile Tools for Java (J2ME) 10 | .mtj.tmp/ 11 | 12 | # Package Files # 13 | *.jar 14 | *.war 15 | *.ear 16 | 17 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 18 | hs_err_pid* 19 | /chapter00/dao/out/ 20 | -------------------------------------------------------------------------------- /9781484251355.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/9781484251355.jpg -------------------------------------------------------------------------------- /Errata.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/Errata.pdf -------------------------------------------------------------------------------- /chapter00/dao/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.dao' 6 | 7 | dependencies { 8 | compile hibernate.core, misc.javaxValidation, misc.jacksonDatabind, misc.jacksonJsr310, spring.contextSupport 9 | } 10 | 11 | jar { 12 | manifest { 13 | attributes( 14 | "Created-By": System.getProperty('java.version'), 15 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 0", 16 | "Implementation-Version": archiveVersion, 17 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 18 | ) 19 | } 20 | } -------------------------------------------------------------------------------- /chapter00/dao/src/main/java/com/apress/cems/dto/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dto; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter00/dao/src/main/java/com/apress/cems/util/CaseStatus.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum CaseStatus { 8 | SUBMITTED, 9 | UNDER_INVESTIGATION, 10 | IN_COURT, 11 | CLOSED, 12 | DISMISSED, 13 | COLD 14 | } 15 | -------------------------------------------------------------------------------- /chapter00/dao/src/main/java/com/apress/cems/util/CaseType.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum CaseType { 8 | UNCATEGORIZED, 9 | INFRACTION, 10 | MISDEMEANOR, 11 | FELONY 12 | } -------------------------------------------------------------------------------- /chapter00/dao/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter00/dao/src/main/java/com/apress/cems/util/TrackAction.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum TrackAction { 8 | SUBMITTED, 9 | RETRIEVED, 10 | RETURNED 11 | } 12 | -------------------------------------------------------------------------------- /chapter00/dao/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.dao { 6 | requires java.persistence; 7 | requires spring.context; 8 | requires java.validation; 9 | requires com.fasterxml.jackson.databind; 10 | requires com.fasterxml.jackson.core; 11 | 12 | exports com.apress.cems.dao; 13 | exports com.apress.cems.dto; 14 | exports com.apress.cems.util; 15 | exports com.apress.cems.ex; 16 | } -------------------------------------------------------------------------------- /chapter00/repos/src/main/java/com/apress/cems/repos/ApressRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.repos; 2 | import java.lang.annotation.ElementType; 3 | import java.lang.annotation.Retention; 4 | import java.lang.annotation.RetentionPolicy; 5 | import java.lang.annotation.Target; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.METHOD) 14 | public @interface ApressRepo { 15 | } 16 | -------------------------------------------------------------------------------- /chapter00/repos/src/main/java/com/apress/cems/repos/CriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Detective; 5 | import com.apress.cems.util.CaseStatus; 6 | import com.apress.cems.util.CaseType; 7 | 8 | import java.util.Optional; 9 | import java.util.Set; 10 | 11 | /** 12 | * @author Iuliana Cosmina 13 | * @since 1.0 14 | */ 15 | public interface CriminalCaseRepo extends AbstractRepo { 16 | 17 | Set findByLeadInvestigator(Detective detective); 18 | 19 | Optional findByNumber(String caseNumber); 20 | 21 | Set findByStatus(CaseStatus status); 22 | 23 | Set findByType(CaseType type); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /chapter00/repos/src/main/java/com/apress/cems/repos/EvidenceRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.Storage; 6 | 7 | import java.util.Optional; 8 | import java.util.Set; 9 | 10 | /** 11 | * @author Iuliana Cosmina 12 | * @since 1.0 13 | */ 14 | public interface EvidenceRepo extends AbstractRepo { 15 | 16 | Set findByCriminalCase(CriminalCase criminalCase); 17 | 18 | Optional findByNumber(String evidenceNumber); 19 | 20 | boolean isInStorage(Storage storage); 21 | } 22 | -------------------------------------------------------------------------------- /chapter00/repos/src/main/java/com/apress/cems/repos/NotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.repos; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 4/17/16. 5 | */ 6 | public class NotFoundException extends RuntimeException { 7 | 8 | public NotFoundException(String message) { 9 | super(message); 10 | } 11 | 12 | public NotFoundException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter00/repos/src/main/java/com/apress/cems/repos/TrackEntryRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.repos; 2 | 3 | import com.apress.cems.dao.TrackEntry; 4 | import com.apress.cems.util.TrackAction; 5 | 6 | import java.util.Date; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface TrackEntryRepo extends AbstractRepo { 14 | 15 | Set findByDetectiveId(Long detectiveId); 16 | Set findByEvidenceId(Long evidenceId); 17 | Set findByDate(Date date); 18 | Set findByDateAndAction(Date date, TrackAction action); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /chapter00/repos/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.repos { 6 | requires com.apress.cems.dao; 7 | requires spring.context; 8 | requires spring.beans; 9 | requires spring.jdbc; 10 | requires spring.tx; // needed only for testing @Transactional on repo 11 | requires java.sql; 12 | requires org.apache.commons.lang3; 13 | 14 | exports com.apress.cems.repos; 15 | exports com.apress.cems.repos.util; 16 | exports com.apress.cems.repos.impl; 17 | } -------------------------------------------------------------------------------- /chapter02/beans-practice/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.beans.practice' 6 | 7 | jar { 8 | manifest { 9 | attributes( 10 | "Created-By": System.getProperty('java.version'), 11 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - Beans practice", 12 | "Implementation-Version": archiveVersion, 13 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 14 | ) 15 | } 16 | } -------------------------------------------------------------------------------- /chapter02/beans-practice/src/main/java/com/apress/cems/beans/Human.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface Human { 8 | 9 | Item getItem(); 10 | } 11 | -------------------------------------------------------------------------------- /chapter02/beans-practice/src/main/java/com/apress/cems/beans/Item.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface Item { 8 | String getTitle(); 9 | } 10 | -------------------------------------------------------------------------------- /chapter02/beans-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */module com.apress.cems.beans.practice { 5 | requires com.apress.cems.dao; 6 | requires java.sql; 7 | requires org.slf4j; 8 | requires spring.context; 9 | requires spring.beans; 10 | } -------------------------------------------------------------------------------- /chapter02/beans/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.beans' 6 | 7 | jar { 8 | manifest { 9 | attributes( 10 | "Created-By": System.getProperty('java.version'), 11 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - Beans", 12 | "Implementation-Version": archiveVersion, 13 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 14 | ) 15 | } 16 | } -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/aw/BadBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.aw; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface BadBean { 8 | MissingBean getMissingBean(); 9 | 10 | BeanTwo getBeanTwo(); 11 | } 12 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/ci/Human.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.ci; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface Human { 8 | 9 | Item getItem(); 10 | } 11 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/ci/Item.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.ci; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface Item { 8 | String getTitle(); 9 | } 10 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/ci/SimpleBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.ci; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface SimpleBean { 8 | } 9 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/misc/TaxFormula.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.misc; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface TaxFormula { 8 | String getFormula(); 9 | } 10 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/scalars/Creature.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.scalars; 2 | 3 | import java.time.LocalDateTime; 4 | 5 | /** 6 | * @author Iuliana Cosmina 7 | * @since 1.0 8 | */ 9 | public interface Creature { 10 | 11 | LocalDateTime getBirthDate(); 12 | 13 | void setBirthDate(LocalDateTime birthDate); 14 | 15 | String getName(); 16 | 17 | void setName(String name); 18 | } 19 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/com/apress/cems/beans/si/AnotherComposedBean.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.beans.si; 2 | 3 | import com.apress.cems.beans.ci.SimpleBean; 4 | 5 | /** 6 | * @author Iuliana Cosmina 7 | * @since 1.0 8 | */ 9 | public interface AnotherComposedBean { 10 | 11 | SimpleBean getSimpleBean(); 12 | 13 | Boolean isComplex(); 14 | } 15 | -------------------------------------------------------------------------------- /chapter02/beans/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.beans { 6 | requires com.apress.cems.dao; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | requires org.slf4j; 10 | requires spring.context; 11 | requires spring.beans; 12 | requires spring.core; 13 | } -------------------------------------------------------------------------------- /chapter02/beans/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter02/boot/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8091 3 | servlet: 4 | context-path: /boot 5 | management: 6 | endpoints: 7 | web: 8 | exposure: 9 | include: 'beans' 10 | 11 | -------------------------------------------------------------------------------- /chapter02/boot/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter02/boot/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter02/boot/src/test/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 9090 3 | servlet: 4 | context-path: /boot-test -------------------------------------------------------------------------------- /chapter02/config-practice/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.config.practice' 6 | 7 | dependencies { 8 | compile project(':chapter02:pojos') 9 | compile misc.h2, spring.jdbc, misc.jsr250, misc.inject 10 | } 11 | 12 | jar { 13 | manifest { 14 | attributes( 15 | "Created-By": System.getProperty('java.version'), 16 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - Configurations Practice", 17 | "Implementation-Version": archiveVersion, 18 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 19 | ) 20 | } 21 | } -------------------------------------------------------------------------------- /chapter02/config-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.config.practice { 6 | requires com.apress.cems.dao; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | requires org.slf4j; 10 | requires spring.context; 11 | requires spring.beans; 12 | requires spring.core; 13 | requires spring.jdbc; 14 | requires java.naming; 15 | requires java.annotation; 16 | 17 | requires com.apress.cems.pojos; 18 | } -------------------------------------------------------------------------------- /chapter02/config-practice/src/main/resources/db/datasource.properties: -------------------------------------------------------------------------------- 1 | db.driverClassName=org.h2.Driver 2 | db.url=jdbc:h2:./sample 3 | db.username=sample 4 | db.password=sample -------------------------------------------------------------------------------- /chapter02/config-practice/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter02/config/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.config' 6 | 7 | dependencies { 8 | api project(':chapter02:pojos') 9 | api project(':chapter02:beans') 10 | api misc.h2, spring.jdbc, spring.webmvc, misc.jsr250, misc.inject, misc.ojdbc 11 | } 12 | 13 | jar { 14 | manifest { 15 | attributes( 16 | "Created-By": System.getProperty('java.version'), 17 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - Configurations", 18 | "Implementation-Version": archiveVersion, 19 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /chapter02/config/src/main/java/com/apress/cems/scopes2/SalaryIdea.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.scopes2; 2 | 3 | import java.util.Random; 4 | 5 | /** 6 | * @author Iuliana Cosmina 7 | * @since 1.0 8 | */ 9 | public interface SalaryIdea { 10 | 11 | Integer getAmount(); 12 | 13 | //de-comment this and the lines in the test to witness the proxying of a default method 14 | /*default Integer defaultMethod() { 15 | System.out.println("Called from here ->" + this.hashCode() ); 16 | return 0; 17 | }*/ 18 | } 19 | -------------------------------------------------------------------------------- /chapter02/config/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.config { 6 | requires com.apress.cems.dao; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | requires org.slf4j; 10 | requires spring.context; 11 | requires spring.beans; 12 | requires spring.core; 13 | requires spring.jdbc; 14 | requires java.naming; 15 | requires java.annotation; 16 | 17 | requires com.apress.cems.pojos; 18 | requires ojdbc8; 19 | } -------------------------------------------------------------------------------- /chapter02/config/src/main/resources/db/prod-datasource.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.pool.OracleDataSource 2 | serviceName=ORCLCDB 3 | serverName=localhost 4 | port=1521 5 | driverType=thin 6 | user=prod 7 | password=prod -------------------------------------------------------------------------------- /chapter02/config/src/test/resources/db/test-datasource.properties: -------------------------------------------------------------------------------- 1 | db.driverClassName=org.h2.Driver 2 | db.url=jdbc:h2:./sample 3 | db.username=sample 4 | db.password=sample -------------------------------------------------------------------------------- /chapter02/config/src/test/resources/db/test2-datasource.properties: -------------------------------------------------------------------------------- 1 | dbProp.driverClassName=org.h2.Driver 2 | dbProp.url=jdbc:h2:./sample 3 | dbProp.username=sample 4 | dbProp.password=sample -------------------------------------------------------------------------------- /chapter02/config/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | 11 | %-5level %logger{5} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.pojos.practice' 6 | 7 | jar { 8 | manifest { 9 | attributes( 10 | "Created-By": System.getProperty('java.version'), 11 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - Pojos practice", 12 | "Implementation-Version": archiveVersion, 13 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 14 | ) 15 | } 16 | } -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/com/apress/cems/pojos/repos/CriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Detective; 5 | 6 | import java.util.Optional; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface CriminalCaseRepo extends AbstractRepo { 14 | 15 | Set findByLeadInvestigator(Detective detective); 16 | 17 | Optional findByNumber(String caseNumber); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/com/apress/cems/pojos/repos/EvidenceRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.Storage; 6 | 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface EvidenceRepo extends AbstractRepo { 14 | 15 | Set findByCriminalCase(CriminalCase criminalCase); 16 | 17 | Evidence findByNumber(String evidenceNumber); 18 | 19 | boolean isInStorage(Storage storage); 20 | } 21 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/com/apress/cems/pojos/repos/PersonRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.Person; 4 | 5 | import java.util.Set; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface PersonRepo extends AbstractRepo { 12 | Person findByUsername(String username); 13 | 14 | Set findByCompleteName(String firstName, String lastName); 15 | } 16 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/com/apress/cems/pojos/repos/TrackEntryRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.TrackEntry; 4 | import com.apress.cems.util.TrackAction; 5 | 6 | import java.util.Date; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface TrackEntryRepo extends AbstractRepo { 14 | 15 | Set findByDetectiveId(Long detectiveId); 16 | Set findByEvidenceId(Long evidenceId); 17 | Set findByDate(Date date); 18 | Set findByDateAndAction(Date date, TrackAction action); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/com/apress/cems/pojos/services/EvidenceService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.services; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.Storage; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface EvidenceService extends AbstractService { 12 | Evidence createEvidence(CriminalCase criminalCase, Storage storage, String itemName); 13 | } 14 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/com/apress/cems/pojos/services/StorageService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.services; 2 | 3 | import com.apress.cems.dao.Storage; 4 | 5 | /** 6 | * @author Iuliana Cosmina 7 | * @since 1.0 8 | */ 9 | public interface StorageService extends AbstractService { 10 | 11 | Storage createStorage(String name, String location); 12 | } 13 | -------------------------------------------------------------------------------- /chapter02/pojos-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.pojos { 6 | requires com.apress.cems.dao; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | 10 | exports com.apress.cems.pojos.repos; 11 | } -------------------------------------------------------------------------------- /chapter02/pojos/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.pojos' 6 | 7 | jar { 8 | manifest { 9 | attributes( 10 | "Created-By": System.getProperty('java.version'), 11 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - Pojos", 12 | "Implementation-Version": archiveVersion, 13 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 14 | ) 15 | } 16 | } -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/com/apress/cems/pojos/repos/CriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Detective; 5 | 6 | import java.util.Optional; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface CriminalCaseRepo extends AbstractRepo { 14 | 15 | Set findByLeadInvestigator(Detective detective); 16 | 17 | Optional findByNumber(String caseNumber); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/com/apress/cems/pojos/repos/EvidenceRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.Storage; 6 | 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface EvidenceRepo extends AbstractRepo { 14 | 15 | Set findByCriminalCase(CriminalCase criminalCase); 16 | 17 | Evidence findByNumber(String evidenceNumber); 18 | 19 | boolean isInStorage(Storage storage); 20 | } 21 | -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/com/apress/cems/pojos/repos/PersonRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.Person; 4 | 5 | import java.util.Set; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface PersonRepo extends AbstractRepo { 12 | Person findByUsername(String username); 13 | 14 | Set findByCompleteName(String firstName, String lastName); 15 | } 16 | -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/com/apress/cems/pojos/repos/TrackEntryRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.repos; 2 | 3 | import com.apress.cems.dao.TrackEntry; 4 | import com.apress.cems.util.TrackAction; 5 | 6 | import java.util.Date; 7 | import java.util.Set; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface TrackEntryRepo extends AbstractRepo { 14 | 15 | Set findByDetectiveId(Long detectiveId); 16 | Set findByEvidenceId(Long evidenceId); 17 | Set findByDate(Date date); 18 | Set findByDateAndAction(Date date, TrackAction action); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/com/apress/cems/pojos/services/EvidenceService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.services; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.Storage; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface EvidenceService extends AbstractService { 12 | Evidence createEvidence(CriminalCase criminalCase, Storage storage, String itemName); 13 | } 14 | -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/com/apress/cems/pojos/services/StorageService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.pojos.services; 2 | 3 | import com.apress.cems.dao.Storage; 4 | 5 | /** 6 | * @author Iuliana Cosmina 7 | * @since 1.0 8 | */ 9 | public interface StorageService extends AbstractService { 10 | 11 | Storage createStorage(String name, String location); 12 | } 13 | -------------------------------------------------------------------------------- /chapter02/pojos/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.pojos { 6 | requires com.apress.cems.dao; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | 10 | exports com.apress.cems.pojos.repos; 11 | exports com.apress.cems.pojos.services; 12 | exports com.apress.cems.pojos.services.impl; 13 | } -------------------------------------------------------------------------------- /chapter02/xml/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | } 6 | 7 | plugins { 8 | id 'java-library' 9 | } 10 | 11 | ext.moduleName = 'com.apress.cems.xml' 12 | 13 | dependencies { 14 | api project(':chapter02:pojos') 15 | api misc.ojdbc 16 | } 17 | 18 | jar { 19 | manifest { 20 | attributes( 21 | "Created-By": System.getProperty('java.version'), 22 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 02 - XML", 23 | "Implementation-Version": archiveVersion, 24 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 25 | ) 26 | } 27 | } -------------------------------------------------------------------------------- /chapter02/xml/docker_developer_tier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter02/xml/docker_developer_tier.png -------------------------------------------------------------------------------- /chapter02/xml/kitematic_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter02/xml/kitematic_view.png -------------------------------------------------------------------------------- /chapter02/xml/sql_developer_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter02/xml/sql_developer_connection.png -------------------------------------------------------------------------------- /chapter02/xml/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.xml { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.pojos; 8 | requires org.apache.commons.lang3; 9 | requires java.sql; 10 | requires org.slf4j; 11 | } -------------------------------------------------------------------------------- /chapter02/xml/src/main/resources/db/datasource.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.OracleDriver 2 | url=jdbc:oracle:thin:@localhost:1521:ORCLCDB 3 | username=prod 4 | password=prod -------------------------------------------------------------------------------- /chapter02/xml/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter02/xml/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter03/boot-test/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | servlet: 4 | context-path: / 5 | spring: 6 | datasource: 7 | url: jdbc:oracle:thin:@localhost:1521:xe 8 | username: sample 9 | password: sample 10 | driver-class-name: oracle.jdbc.OracleDriver 11 | jpa: 12 | generate-ddl: true 13 | hibernate: 14 | ddl-auto: create -------------------------------------------------------------------------------- /chapter03/boot-test/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter03/boot-test/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter03/boot-test/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: org.h2.Driver 4 | url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 5 | username: sa 6 | password: 7 | -------------------------------------------------------------------------------- /chapter03/junit-tests/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.junit' 6 | 7 | dependencies { 8 | api project(':chapter03:test-base') 9 | testCompile testing.junit, testing.easymock, testing.jmockju4, testing.mockitoAll 10 | testRuntimeOnly testing.vintageEngine 11 | } 12 | 13 | jar { 14 | manifest { 15 | attributes( 16 | "Created-By": System.getProperty('java.version'), 17 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 03 - JUnit 4 Tests", 18 | "Implementation-Version": archiveVersion, 19 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /chapter03/spring-profiles/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.spring.tests.jupiter { 5 | requires com.apress.cems.dao; 6 | requires org.apache.commons.lang3; 7 | requires java.sql; 8 | 9 | requires spring.context; 10 | requires spring.beans; 11 | requires spring.core; 12 | requires java.annotation; 13 | requires spring.jdbc; 14 | requires java.naming; 15 | requires ojdbc8; 16 | } -------------------------------------------------------------------------------- /chapter03/spring-profiles/src/main/resources/db/prod-datasource.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.pool.OracleDataSource 2 | serviceName=ORCLCDB 3 | serverName=localhost 4 | port=1521 5 | driverType=thin 6 | user=prod 7 | password=prod -------------------------------------------------------------------------------- /chapter03/spring-profiles/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGENUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGENUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter03/spring-profiles/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter03/spring-profiles/src/test/resources/db/test-datasource.properties: -------------------------------------------------------------------------------- 1 | db.driverClassName=org.h2.Driver 2 | db.url=jdbc:h2:./jupiter 3 | db.username=jupiter 4 | db.password=jupiter -------------------------------------------------------------------------------- /chapter03/spring-tests-junit/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.spring.tests.junit { 5 | requires com.apress.cems.dao; 6 | requires org.apache.commons.lang3; 7 | requires java.sql; 8 | 9 | requires spring.context; 10 | requires spring.beans; 11 | requires spring.core; 12 | requires spring.jdbc; 13 | requires java.annotation; 14 | } -------------------------------------------------------------------------------- /chapter03/spring-tests-junit/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGENUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGENUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter03/spring-tests-junit/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter03/spring-tests-junit/src/test/resources/db/test-datasource.properties: -------------------------------------------------------------------------------- 1 | db.driverClassName=org.h2.Driver 2 | db.url=jdbc:h2:./junit 3 | db.username=junit 4 | db.password=junit -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.spring.tests.jupiter { 5 | requires com.apress.cems.dao; 6 | requires org.apache.commons.lang3; 7 | requires java.sql; 8 | 9 | requires spring.context; 10 | requires spring.beans; 11 | requires spring.core; 12 | requires spring.jdbc; 13 | requires java.annotation; 14 | } -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/test/resources/db/person-schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGENUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGENUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/test/resources/db/test-data-one.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/test/resources/db/test-data-two.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter03/spring-tests-jupiter/src/test/resources/db/test-datasource.properties: -------------------------------------------------------------------------------- 1 | db.driverClassName=org.h2.Driver 2 | db.url=jdbc:h2:./jupiter 3 | db.username=jupiter 4 | db.password=jupiter -------------------------------------------------------------------------------- /chapter03/spring-tests-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.spring.tests.practice { 5 | requires com.apress.cems.dao; 6 | requires org.apache.commons.lang3; 7 | requires java.sql; 8 | 9 | requires spring.context; 10 | requires spring.beans; 11 | requires spring.core; 12 | requires spring.jdbc; 13 | requires java.annotation; 14 | } -------------------------------------------------------------------------------- /chapter03/spring-tests-practice/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGENUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGENUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter03/spring-tests-practice/src/test/resources/db/test-data-one.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); -------------------------------------------------------------------------------- /chapter03/spring-tests-practice/src/test/resources/db/test-data-two.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter03/spring-tests-practice/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter03/spring-tests-practice/src/test/resources/db/test-datasource.properties: -------------------------------------------------------------------------------- 1 | db.driverClassName=org.h2.Driver 2 | db.url=jdbc:h2:./jupiter 3 | db.username=jupiter 4 | db.password=jupiter -------------------------------------------------------------------------------- /chapter03/test-base/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.test.base' 6 | 7 | dependencies { 8 | compile project(':chapter00:repos') 9 | } 10 | 11 | jar { 12 | manifest { 13 | attributes( 14 | "Created-By": System.getProperty('java.version'), 15 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 03 - Test Base classes", 16 | "Implementation-Version": archiveVersion, 17 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 18 | ) 19 | } 20 | } -------------------------------------------------------------------------------- /chapter03/test-base/src/main/java/com/apress/cems/services/EvidenceService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.services; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.Storage; 6 | 7 | import java.util.Optional; 8 | import java.util.Set; 9 | 10 | /** 11 | * @author Iuliana Cosmina 12 | * @since 1.0 13 | */ 14 | public interface EvidenceService extends AbstractService { 15 | Evidence createEvidence(CriminalCase criminalCase, Storage storage, String itemName); 16 | 17 | Set findByCriminalCase(CriminalCase criminalCase); 18 | 19 | Optional findByNumber(String evidenceNumber); 20 | } 21 | -------------------------------------------------------------------------------- /chapter03/test-base/src/main/java/com/apress/cems/services/PersonService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.services; 2 | 3 | import com.apress.cems.dao.Person; 4 | 5 | import java.util.Optional; 6 | import java.util.Set; 7 | 8 | /** 9 | * @author Iuliana Cosmina 10 | * @since 1.0 11 | */ 12 | public interface PersonService extends AbstractService { 13 | 14 | Person createPerson(String firstName, String lastName); 15 | 16 | Optional findByUsername(String username); 17 | 18 | Optional findByFirstNameAndLastName(String firstName, String lastName); 19 | } 20 | -------------------------------------------------------------------------------- /chapter03/test-base/src/main/java/com/apress/cems/services/StorageService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.services; 2 | 3 | import com.apress.cems.dao.Storage; 4 | 5 | import java.util.Optional; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface StorageService extends AbstractService { 12 | 13 | Storage createStorage(String name, String location); 14 | 15 | Optional findByName(String name); 16 | 17 | Optional findByLocation(String location); 18 | } 19 | -------------------------------------------------------------------------------- /chapter03/test-base/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.three.base { 5 | requires com.apress.cems.dao; 6 | requires com.apress.cems.repos; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | 10 | requires spring.context; 11 | requires spring.beans; 12 | requires spring.core; 13 | requires java.annotation; 14 | } -------------------------------------------------------------------------------- /chapter04/aop-base/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.spring.tests.junit { 5 | requires com.apress.cems.dao; 6 | requires com.apress.cems.repos; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | /* 10 | requires spring.context; 11 | requires spring.beans; 12 | requires spring.core; 13 | requires java.annotation;*/ 14 | } -------------------------------------------------------------------------------- /chapter04/aop-base/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGENUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGENUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter04/aop-base/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter04/aop-extras/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.aop.extras' 6 | 7 | dependencies { 8 | testCompile testing.api, testing.platformRunner, testing.mockito, spring.test 9 | testImplementation testing.api 10 | testRuntime testing.engine, testing.platformRunner 11 | } 12 | 13 | jar { 14 | manifest { 15 | attributes( 16 | "Created-By": System.getProperty('java.version'), 17 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 04 - Spring AOP Extra Examples", 18 | "Implementation-Version": archiveVersion, 19 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /chapter04/aop-extras/self-invocation-hoax.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter04/aop-extras/self-invocation-hoax.jpg -------------------------------------------------------------------------------- /chapter04/aop-extras/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.aop.extras { 5 | requires com.apress.cems.dao; 6 | requires com.apress.cems.repos; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | requires spring.jdbc; 10 | 11 | requires spring.context; 12 | requires spring.beans; 13 | requires spring.core; 14 | requires spring.aop; 15 | requires org.aspectj.weaver; 16 | requires org.slf4j; 17 | } -------------------------------------------------------------------------------- /chapter04/aop-practice/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.aop.practice' 6 | 7 | dependencies { 8 | testCompile testing.api, testing.platformRunner, testing.mockito, spring.test 9 | testImplementation testing.api 10 | testRuntime testing.engine, testing.platformRunner 11 | } 12 | 13 | jar { 14 | manifest { 15 | attributes( 16 | "Created-By": System.getProperty('java.version'), 17 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 04 - Spring AOP Practice", 18 | "Implementation-Version": archiveVersion, 19 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /chapter04/aop-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.aop.practice { 5 | requires com.apress.cems.dao; 6 | requires com.apress.cems.repos; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | requires spring.jdbc; 10 | 11 | requires spring.context; 12 | requires spring.beans; 13 | requires spring.core; 14 | requires org.aspectj.weaver; 15 | requires org.slf4j; 16 | } -------------------------------------------------------------------------------- /chapter04/aop-practice/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter04/aop-practice/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | 11 | %-5level %logger{5} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chapter04/aop-xml/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.aop.xml' 6 | 7 | dependencies { 8 | testCompile testing.api, testing.platformRunner, testing.mockito, spring.test 9 | testImplementation testing.api 10 | testRuntime testing.engine, testing.platformRunner 11 | } 12 | 13 | jar { 14 | manifest { 15 | attributes( 16 | "Created-By": System.getProperty('java.version'), 17 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 04 - Spring AOP XML", 18 | "Implementation-Version": archiveVersion, 19 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /chapter04/aop-xml/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.aop.xml { 5 | requires com.apress.cems.dao; 6 | requires com.apress.cems.repos; 7 | requires org.apache.commons.lang3; 8 | requires java.sql; 9 | 10 | requires spring.context; 11 | requires spring.beans; 12 | requires spring.core; 13 | requires org.aspectj.weaver; 14 | requires org.slf4j; 15 | } -------------------------------------------------------------------------------- /chapter04/aop-xml/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGENUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGENUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter04/aop-xml/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter04/aop-xml/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | 11 | %-5level %logger{5} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chapter04/aop/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.aop' 6 | 7 | dependencies { 8 | testCompile testing.api, testing.platformRunner, testing.mockito, spring.test 9 | testImplementation testing.api 10 | testRuntime testing.engine, testing.platformRunner 11 | } 12 | 13 | jar { 14 | manifest { 15 | attributes( 16 | "Created-By": System.getProperty('java.version'), 17 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 04 - Spring AOP", 18 | "Implementation-Version": archiveVersion, 19 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 20 | ) 21 | } 22 | } -------------------------------------------------------------------------------- /chapter04/aop/src/main/java/com/apress/cems/aop/ApressService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.aop; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * @author Iuliana Cosmina 10 | * @since 1.0 11 | */ 12 | 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Target(ElementType.TYPE) 15 | public @interface ApressService { 16 | } 17 | -------------------------------------------------------------------------------- /chapter04/aop/src/main/java/com/apress/cems/aop/service/DetectiveService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.aop.service; 2 | 3 | import com.apress.cems.dao.Detective; 4 | import com.apress.cems.dao.Person; 5 | import com.apress.cems.util.Rank; 6 | 7 | import java.util.Optional; 8 | import java.util.Set; 9 | 10 | /** 11 | * @author Iuliana Cosmina 12 | * @since 1.0 13 | */ 14 | public interface DetectiveService { 15 | 16 | Set findAll(); 17 | 18 | Optional findById(Long id); 19 | 20 | Detective createDetective(Person person, Rank rank); 21 | 22 | Optional findByBadgeNumber(String badgeNumber); 23 | 24 | Set findByRank(Rank rank); 25 | } 26 | -------------------------------------------------------------------------------- /chapter04/aop/src/main/java/com/apress/cems/aop/service/StorageService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.aop.service; 2 | 3 | import com.apress.cems.dao.Storage; 4 | 5 | import java.util.Optional; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface StorageService { 12 | Optional findByName(String name); 13 | 14 | Optional findByLocation(String location); 15 | 16 | void save(Storage storage); 17 | 18 | void saveEvidenceSet(Storage storage); 19 | 20 | void delete(Storage entity); 21 | 22 | int deleteById(Long entityId); 23 | 24 | Optional findById(Long entityId); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /chapter04/aop/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by iuliana.cosmina on 21/01/19. 3 | */ 4 | module com.apress.cems.aop { 5 | exports com.apress.cems.aop.service; 6 | exports com.apress.cems.aop.exception; 7 | requires com.apress.cems.dao; 8 | requires com.apress.cems.repos; 9 | requires org.apache.commons.lang3; 10 | requires java.sql; 11 | requires spring.jdbc; 12 | 13 | requires spring.context; 14 | requires spring.beans; 15 | requires spring.core; 16 | requires org.aspectj.weaver; 17 | requires org.slf4j; 18 | } -------------------------------------------------------------------------------- /chapter04/aop/src/test/resources/db/test-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1, 'sherlock.holmes', 'Sherlock', 'Holmes', '123ss12sh', '1983-08-18 00:01', 1, '1983-08-18 00:01', '1999-03-18 00:02' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (2, 'irene.adler', 'Irene', 'Adler', 'id123ds', '1990-08-18 00:03', 1, '1990-07-18 00:04', '1990-07-18 00:05'); -------------------------------------------------------------------------------- /chapter04/aop/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | 11 | %-5level %logger{5} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chapter04/boot-aop/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | url: jdbc:oracle:thin:@localhost:1521:xe 4 | username: sample 5 | password: sample 6 | driver-class-name: oracle.jdbc.OracleDriver 7 | jpa: 8 | generate-ddl: true 9 | hibernate: 10 | ddl-auto: create -------------------------------------------------------------------------------- /chapter04/boot-aop/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter04/boot-aop/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter04/boot-aop/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | datasource: 3 | driver-class-name: org.h2.Driver 4 | url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 5 | username: sa 6 | password: 7 | 8 | -------------------------------------------------------------------------------- /chapter04/boot-aop/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | 11 | %-5level %logger{5} - %msg%n 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/java/com/apress/cems/util/CaseStatus.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum CaseStatus { 8 | SUBMITTED, 9 | UNDER_INVESTIGATION, 10 | IN_COURT, 11 | CLOSED, 12 | DISMISSED, 13 | COLD 14 | } 15 | -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/java/com/apress/cems/util/CaseType.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum CaseType { 8 | UNCATEGORIZED, 9 | INFRACTION, 10 | MISDEMEANOR, 11 | FELONY 12 | } -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/java/com/apress/cems/util/TrackAction.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum TrackAction { 8 | SUBMITTED, 9 | RETRIEVED, 10 | RETURNED 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8081 3 | servlet: 4 | context-path: / 5 | spring: 6 | datasource: 7 | url: jdbc:oracle:thin:@localhost:1521:xe 8 | username: sample 9 | password: sample 10 | driver-class-name: oracle.jdbc.OracleDriver 11 | jpa: 12 | generate-ddl: true 13 | hibernate: 14 | ddl-auto: create -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter05/boot-jpa/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter05/boot-mongo/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | pattern: 3 | console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" 4 | level: 5 | root: INFO 6 | org.springframework: INFO 7 | com.apress.cems.mongo: DEBUG 8 | 9 | spring: 10 | data: 11 | mongodb: 12 | host: 127.0.0.1 13 | port: 12345 -------------------------------------------------------------------------------- /chapter05/data-jpa-practice/src/main/java/com/apress/cems/dj/repos/CriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * @author Iuliana Cosmina 8 | * @since 1.0 9 | */ 10 | public interface CriminalCaseRepo extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/data-jpa-practice/src/main/java/com/apress/cems/dj/repos/StorageRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.Storage; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * @author Iuliana Cosmina 8 | * @since 1.0 9 | */ 10 | public interface StorageRepo extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/data-jpa-practice/src/main/java/com/apress/cems/dj/repos/TrackEntryRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.TrackEntry; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * @author Iuliana Cosmina 8 | * @since 1.0 9 | */ 10 | public interface TrackEntryRepo extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/data-jpa-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.dj.practice { 6 | requires com.apress.cems.dao; 7 | requires org.hibernate.orm.core; 8 | 9 | requires org.apache.commons.lang3; 10 | requires java.sql; 11 | requires org.slf4j; 12 | requires java.naming; 13 | requires java.annotation; 14 | 15 | requires spring.data.jpa; 16 | requires spring.context; 17 | requires spring.beans; 18 | requires spring.core; 19 | requires spring.jdbc; 20 | requires spring.tx; 21 | requires spring.orm; 22 | requires java.persistence; 23 | requires spring.data.commons; 24 | } -------------------------------------------------------------------------------- /chapter05/data-jpa-practice/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create-drop -------------------------------------------------------------------------------- /chapter05/data-jpa/src/main/java/com/apress/cems/dj/repos/CriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Detective; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface CriminalCaseRepo extends JpaRepository { 14 | List findByLeadInvestigator(Detective detective); 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/data-jpa/src/main/java/com/apress/cems/dj/repos/StorageRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.Storage; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * @author Iuliana Cosmina 8 | * @since 1.0 9 | */ 10 | public interface StorageRepo extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/data-jpa/src/main/java/com/apress/cems/dj/repos/TrackEntryRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.Detective; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.TrackEntry; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import java.time.LocalDateTime; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Iuliana Cosmina 13 | * @since 1.0 14 | */ 15 | public interface TrackEntryRepo extends JpaRepository { 16 | List findByDate(LocalDateTime localDate); 17 | 18 | List findByEvidence(Evidence evidence); 19 | 20 | List findByDetective(Detective detective); 21 | } 22 | -------------------------------------------------------------------------------- /chapter05/data-jpa/src/main/java/com/apress/cems/dj/services/TrackEntryService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.services; 2 | 3 | import com.apress.cems.dao.Detective; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.TrackEntry; 6 | 7 | import java.time.LocalDateTime; 8 | import java.util.List; 9 | 10 | /** 11 | * @author Iuliana Cosmina 12 | * @since 1.0 13 | */ 14 | public interface TrackEntryService { 15 | 16 | List findByDate(LocalDateTime localDate); 17 | 18 | List findByEvidence(Evidence evidence); 19 | 20 | List findByDetective(Detective detective); 21 | 22 | TrackEntry save(TrackEntry entry); 23 | } 24 | -------------------------------------------------------------------------------- /chapter05/data-jpa/src/main/resources/prod-database.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.pool.OracleDataSource 2 | serviceName=ORCLCDB 3 | serverName=localhost 4 | port=1521 5 | driverType=thin 6 | user=prod 7 | password=prod 8 | dialect=org.hibernate.dialect.Oracle12cDialect 9 | hbm2ddl=update 10 | #hbm2ddl=create-drop -------------------------------------------------------------------------------- /chapter05/data-jpa/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems_dj;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/emf-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.emf.practice { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires com.apress.cems.aop; 9 | 10 | requires org.hibernate.orm.core; 11 | 12 | requires org.apache.commons.lang3; 13 | requires java.sql; 14 | requires org.slf4j; 15 | requires java.naming; 16 | requires java.annotation; 17 | 18 | requires spring.context; 19 | requires spring.beans; 20 | requires spring.core; 21 | requires spring.jdbc; 22 | requires spring.tx; 23 | requires spring.orm; 24 | requires java.persistence; 25 | } -------------------------------------------------------------------------------- /chapter05/emf-practice/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./cems;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/emf/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.emf { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires com.apress.cems.aop; 9 | 10 | requires org.hibernate.orm.core; 11 | 12 | requires org.apache.commons.lang3; 13 | requires java.sql; 14 | requires org.slf4j; 15 | requires java.naming; 16 | requires java.annotation; 17 | 18 | requires spring.context; 19 | requires spring.beans; 20 | requires spring.core; 21 | requires spring.jdbc; 22 | requires spring.tx; 23 | requires spring.orm; 24 | requires java.persistence; 25 | } -------------------------------------------------------------------------------- /chapter05/emf/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./cems;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/hibernate-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.hib.practice { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires com.apress.cems.aop; 9 | 10 | requires org.hibernate.orm.core; 11 | 12 | requires org.apache.commons.lang3; 13 | requires java.sql; 14 | requires org.slf4j; 15 | requires java.naming; 16 | requires java.annotation; 17 | 18 | requires spring.context; 19 | requires spring.beans; 20 | requires spring.core; 21 | requires spring.jdbc; 22 | requires spring.tx; 23 | requires spring.orm; 24 | } -------------------------------------------------------------------------------- /chapter05/hibernate-practice/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./cems_hib_test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/hibernate/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.hib { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires com.apress.cems.aop; 9 | 10 | requires org.hibernate.orm.core; 11 | 12 | requires org.apache.commons.lang3; 13 | requires java.sql; 14 | requires org.slf4j; 15 | requires java.naming; 16 | requires java.annotation; 17 | 18 | requires spring.context; 19 | requires spring.beans; 20 | requires spring.core; 21 | requires spring.jdbc; 22 | requires spring.tx; 23 | requires spring.orm; 24 | } -------------------------------------------------------------------------------- /chapter05/hibernate/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./cems_hib;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/jdbc-practice/src/main/java/com/apress/cems/jdbc/repos/AgnosticRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.jdbc.repos; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface AgnosticRepo { 8 | int createTable(String name); 9 | } 10 | -------------------------------------------------------------------------------- /chapter05/jdbc-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.jdbc.practice { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires org.apache.commons.lang3; 9 | requires java.sql; 10 | requires org.slf4j; 11 | requires spring.context; 12 | requires spring.beans; 13 | requires spring.core; 14 | requires spring.jdbc; 15 | requires java.naming; 16 | requires java.annotation; 17 | } -------------------------------------------------------------------------------- /chapter05/jdbc-practice/src/main/resources/connection.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.OracleDriver 2 | url=jdbc:oracle:thin:@localhost:1521:ORCLCDB 3 | username=prod 4 | password=prod -------------------------------------------------------------------------------- /chapter05/jdbc-practice/src/test/resources/db/connection.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.driverClassName=org.h2.Driver 3 | db.url=jdbc:h2:./sample;DB_CLOSE_ON_EXIT=FALSE 4 | db.username=sample 5 | db.password=sample -------------------------------------------------------------------------------- /chapter05/jdbc-practice/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGE_NUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGE_NUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter05/jdbc/src/main/java/com/apress/cems/jdbc/repos/AgnosticRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.jdbc.repos; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public interface AgnosticRepo { 8 | int createTable(String name); 9 | } 10 | -------------------------------------------------------------------------------- /chapter05/jdbc/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.jdbc { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires org.apache.commons.lang3; 9 | requires java.sql; 10 | requires org.slf4j; 11 | requires spring.context; 12 | requires spring.beans; 13 | requires spring.core; 14 | requires spring.jdbc; 15 | requires java.naming; 16 | requires java.annotation; 17 | } -------------------------------------------------------------------------------- /chapter05/jdbc/src/main/resources/connection.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.OracleDriver 2 | url=jdbc:oracle:thin:@localhost:1521:ORCLCDB 3 | username=prod 4 | password=prod -------------------------------------------------------------------------------- /chapter05/jdbc/src/test/resources/db/connection.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.driverClassName=org.h2.Driver 3 | db.url=jdbc:h2:./sample;DB_CLOSE_ON_EXIT=FALSE 4 | db.username=sample 5 | db.password=sample -------------------------------------------------------------------------------- /chapter05/jdbc/src/test/resources/db/schema.sql: -------------------------------------------------------------------------------- 1 | drop table PERSON if exists; 2 | 3 | CREATE TABLE PERSON 4 | ( 5 | ID BIGINT IDENTITY PRIMARY KEY 6 | , USERNAME VARCHAR2(50) NOT NULL 7 | , FIRSTNAME VARCHAR2(50) 8 | , LASTNAME VARCHAR2(50) 9 | , PASSWORD VARCHAR2(50) NOT NULL 10 | , HIRINGDATE TIMESTAMP 11 | , VERSION INT 12 | , CREATED_AT TIMESTAMP NOT NULL 13 | , MODIFIED_AT TIMESTAMP NOT NULL 14 | , UNIQUE(USERNAME) 15 | ); 16 | 17 | drop table DETECTIVE if exists; 18 | 19 | CREATE TABLE DETECTIVE 20 | ( 21 | ID BIGINT IDENTITY PRIMARY KEY 22 | , PERSON_ID INT NOT NULL 23 | , BADGE_NUMBER VARCHAR2(50) 24 | , RANK VARCHAR2(50) 25 | , ARMED BOOLEAN 26 | , STATUS VARCHAR2(50) 27 | , VERSION INT 28 | , CREATED_AT TIMESTAMP NOT NULL 29 | , MODIFIED_AT TIMESTAMP NOT NULL 30 | , UNIQUE(BADGE_NUMBER) 31 | ); -------------------------------------------------------------------------------- /chapter05/mongo-simple/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | } 4 | 5 | ext.moduleName = 'com.apress.cems.mongo' 6 | 7 | dependencies { 8 | compile spring.mongo 9 | testCompile testing.api, testing.platformRunner, testing.mockito, spring.test 10 | testImplementation testing.api 11 | testRuntime testing.engine, testing.platformRunner 12 | } 13 | 14 | jar { 15 | manifest { 16 | attributes( 17 | "Created-By": System.getProperty('java.version'), 18 | "Specification-Title": "Pivotal Certified Professional Spring Developer Exam - Chapter 05 - Spring MongoDb Application", 19 | "Implementation-Version": archiveVersion, 20 | "Class-Path": configurations.compile.collect { it.getName() }.join(' ') 21 | ) 22 | } 23 | } -------------------------------------------------------------------------------- /chapter05/mongo-simple/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.mongo { 6 | requires org.slf4j; 7 | requires spring.context; 8 | requires spring.beans; 9 | requires spring.core; 10 | requires java.naming; 11 | requires java.annotation; 12 | requires spring.data.commons; 13 | requires spring.data.mongodb; 14 | } -------------------------------------------------------------------------------- /chapter05/mongo-simple/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter05/mongo-simple/src/test/resources/mongo.properties: -------------------------------------------------------------------------------- 1 | db.name=test 2 | db.host=127.0.0.1 3 | db.port=27017 -------------------------------------------------------------------------------- /chapter05/mongo-transactions/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.mongo.tx { 6 | requires org.slf4j; 7 | requires spring.context; 8 | requires spring.beans; 9 | requires spring.core; 10 | requires spring.tx; 11 | requires java.naming; 12 | requires java.annotation; 13 | requires spring.data.commons; 14 | requires spring.data.mongodb; 15 | } -------------------------------------------------------------------------------- /chapter05/mongo-transactions/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter05/mongo-transactions/src/test/resources/mongo.properties: -------------------------------------------------------------------------------- 1 | db.name=test 2 | db.host=127.0.0.1 3 | db.port=27017 -------------------------------------------------------------------------------- /chapter05/sandbox/src/main/java/com/apress/cems/dj/sandbox/repos/cc/CustomizedCriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.sandbox.repos.cc; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Detective; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Iuliana Cosmina 10 | * @since 1.0 11 | */ 12 | public interface CustomizedCriminalCaseRepo { 13 | 14 | List getTeam(CriminalCase criminalCase); 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/sandbox/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.dj.sabdbox { 6 | requires com.apress.cems.dao; 7 | requires org.hibernate.orm.core; 8 | 9 | requires org.apache.commons.lang3; 10 | requires java.sql; 11 | requires org.slf4j; 12 | requires java.naming; 13 | requires java.annotation; 14 | 15 | requires spring.data.jpa; 16 | requires spring.context; 17 | requires spring.beans; 18 | requires spring.core; 19 | requires spring.jdbc; 20 | requires spring.tx; 21 | requires spring.orm; 22 | requires java.persistence; 23 | requires spring.data.commons; 24 | } -------------------------------------------------------------------------------- /chapter05/sandbox/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./sandbox;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password= 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/sec-data-jpa/src/main/java/com/apress/cems/dj/repos/CriminalCaseRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.CriminalCase; 4 | import com.apress.cems.dao.Detective; 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author Iuliana Cosmina 11 | * @since 1.0 12 | */ 13 | public interface CriminalCaseRepo extends JpaRepository { 14 | List findByLeadInvestigator(Detective detective); 15 | } 16 | -------------------------------------------------------------------------------- /chapter05/sec-data-jpa/src/main/java/com/apress/cems/dj/repos/StorageRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.Storage; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * @author Iuliana Cosmina 8 | * @since 1.0 9 | */ 10 | public interface StorageRepo extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /chapter05/sec-data-jpa/src/main/java/com/apress/cems/dj/repos/TrackEntryRepo.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.repos; 2 | 3 | import com.apress.cems.dao.Detective; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.TrackEntry; 6 | import org.springframework.data.jpa.repository.JpaRepository; 7 | 8 | import java.time.LocalDateTime; 9 | import java.util.List; 10 | 11 | /** 12 | * @author Iuliana Cosmina 13 | * @since 1.0 14 | */ 15 | public interface TrackEntryRepo extends JpaRepository { 16 | List findByDate(LocalDateTime localDate); 17 | 18 | List findByEvidence(Evidence evidence); 19 | 20 | List findByDetective(Detective detective); 21 | } 22 | -------------------------------------------------------------------------------- /chapter05/sec-data-jpa/src/main/java/com/apress/cems/dj/services/TrackEntryService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.dj.services; 2 | 3 | import com.apress.cems.dao.Detective; 4 | import com.apress.cems.dao.Evidence; 5 | import com.apress.cems.dao.TrackEntry; 6 | 7 | import java.time.LocalDateTime; 8 | import java.util.List; 9 | 10 | /** 11 | * @author Iuliana Cosmina 12 | * @since 1.0 13 | */ 14 | public interface TrackEntryService { 15 | 16 | List findByDate(LocalDateTime localDate); 17 | 18 | List findByEvidence(Evidence evidence); 19 | 20 | List findByDetective(Detective detective); 21 | 22 | TrackEntry save(TrackEntry entry); 23 | } 24 | -------------------------------------------------------------------------------- /chapter05/sec-data-jpa/src/main/resources/prod-database.properties: -------------------------------------------------------------------------------- 1 | driverClassName=oracle.jdbc.pool.OracleDataSource 2 | serviceName=ORCLCDB 3 | serverName=localhost 4 | port=1521 5 | driverType=thin 6 | user=prod 7 | password=prod 8 | dialect=org.hibernate.dialect.Oracle12cDialect 9 | hbm2ddl=update 10 | #hbm2ddl=create-drop -------------------------------------------------------------------------------- /chapter05/sec-data-jpa/src/test/resources/db/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems_dj;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter05/transactions-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.tx.practice { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires com.apress.cems.aop; 9 | requires org.apache.commons.lang3; 10 | requires java.sql; 11 | requires org.slf4j; 12 | requires spring.context; 13 | requires spring.beans; 14 | requires spring.core; 15 | requires spring.jdbc; 16 | requires spring.tx; 17 | requires java.naming; 18 | requires java.annotation; 19 | } -------------------------------------------------------------------------------- /chapter05/transactions-practice/src/test/resources/db/connection.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.driverClassName=org.h2.Driver 3 | db.url=jdbc:h2:./sample;DB_CLOSE_ON_EXIT=FALSE 4 | db.username=sample 5 | db.password=sample -------------------------------------------------------------------------------- /chapter05/transactions-practice/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter05/transactions-practice/src/test/resources/test/delete-test-data.sql: -------------------------------------------------------------------------------- 1 | delete from PERSON where ID>=3; -------------------------------------------------------------------------------- /chapter05/transactions-practice/src/test/resources/test/extra-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (3, 'test.user', 'Test', 'User', 'xxxx', '1983-01-15 00:14', 1, '1983-01-15 00:14', '2000-03-18 00:15' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (4, 'test.user2', 'Test', 'User2', 'yyyy', '1990-02-11 00:16', 1, '1992-07-18 00:17', '2001-01-18 00:18'); 3 | -------------------------------------------------------------------------------- /chapter05/transactions/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.tx { 6 | requires com.apress.cems.dao; 7 | requires com.apress.cems.repos; 8 | requires com.apress.cems.aop; 9 | requires org.apache.commons.lang3; 10 | requires java.sql; 11 | requires org.slf4j; 12 | requires spring.context; 13 | requires spring.beans; 14 | requires spring.core; 15 | requires spring.jdbc; 16 | requires spring.tx; 17 | requires java.naming; 18 | requires java.annotation; 19 | } -------------------------------------------------------------------------------- /chapter05/transactions/src/test/java/com/apress/cems/tx/one/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | * Description: this package contains sources to test a Spring configuration with multiple transaction managers, when one of them is set as default. 5 | */ 6 | package com.apress.cems.tx.one; -------------------------------------------------------------------------------- /chapter05/transactions/src/test/java/com/apress/cems/tx/three/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | * Description: this package contains sources to test a Spring configuration with multiple transaction managers, when one of them is set as @Primary. 5 | */ 6 | package com.apress.cems.tx.three; -------------------------------------------------------------------------------- /chapter05/transactions/src/test/java/com/apress/cems/tx/two/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | * Description: this package contains sources to test a Spring configuration with multiple transaction managers, when none of them is set as default. 5 | */ 6 | package com.apress.cems.tx.two; -------------------------------------------------------------------------------- /chapter05/transactions/src/test/resources/db/connection.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.driverClassName=org.h2.Driver 3 | db.url=jdbc:h2:./sample;DB_CLOSE_ON_EXIT=FALSE 4 | db.username=sample 5 | db.password=sample -------------------------------------------------------------------------------- /chapter05/transactions/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | 10 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /chapter05/transactions/src/test/resources/test/delete-test-data.sql: -------------------------------------------------------------------------------- 1 | delete from PERSON where ID>=999; -------------------------------------------------------------------------------- /chapter05/transactions/src/test/resources/test/extra-data.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (999, 'test.user', 'Test', 'User', 'xxxx', '1983-01-15 00:14', 1, '1983-01-15 00:14', '2000-03-18 00:15' ); 2 | INSERT INTO PERSON(ID, USERNAME, FIRSTNAME, LASTNAME, PASSWORD, HIRINGDATE, VERSION, CREATED_AT, MODIFIED_AT) VALUES (1000, 'test.user2', 'Test', 'User2', 'yyyy', '1990-02-11', 1, '1992-07-18 00:17', '2001-01-18 00:18'); 3 | -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/java/com/apress/cems/practice/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.practice.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/java/com/apress/cems/practice/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.practice.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/static/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web-practice/src/main/resources/static/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/static/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web-practice/src/main/resources/static/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/static/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web-practice/src/main/resources/static/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/static/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web-practice/src/main/resources/static/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web-practice/src/main/resources/static/images/favicon.ico -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/static/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter06/boot-web-practice/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |

19 |
20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/static/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web/src/main/resources/static/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/static/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web/src/main/resources/static/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/static/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web/src/main/resources/static/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/static/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web/src/main/resources/static/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/boot-web/src/main/resources/static/images/favicon.ico -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/static/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter06/boot-web/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |

19 |

20 |
21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | 6 | module com.apress.cems.web { 7 | requires com.apress.cems.dao; 8 | requires com.apress.cems.dj; 9 | 10 | requires java.naming; 11 | 12 | requires spring.core; 13 | requires spring.webmvc; 14 | requires spring.context; 15 | requires spring.web; 16 | 17 | requires javax.servlet.api; 18 | requires org.slf4j; 19 | requires java.annotation; 20 | requires com.zaxxer.hikari; 21 | requires spring.beans; 22 | requires java.sql; 23 | 24 | exports com.apress.cems.web.config; 25 | exports com.apress.cems.web.controllers; 26 | exports com.apress.cems.web.problem; 27 | opens com.apress.cems.web.config to spring.core; 28 | } -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems01;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-practice/src/main/webapp/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-practice/src/main/webapp/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-practice/src/main/webapp/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-practice/src/main/webapp/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-practice/src/main/webapp/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | 6 | module com.apress.cems.web.xml { 7 | requires com.apress.cems.dao; 8 | requires com.apress.cems.dj; 9 | 10 | requires java.naming; 11 | 12 | requires spring.core; 13 | requires spring.webmvc; 14 | requires spring.context; 15 | requires spring.web; 16 | 17 | requires javax.servlet.api; 18 | requires org.slf4j; 19 | requires java.annotation; 20 | requires com.zaxxer.hikari; 21 | requires spring.beans; 22 | requires java.sql; 23 | 24 | exports com.apress.cems.web.config; 25 | exports com.apress.cems.web.controllers; 26 | exports com.apress.cems.web.problem; 27 | opens com.apress.cems.web.config to spring.core; 28 | } -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems01;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/WEB-INF/home/hello.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 | Hello there ${name}! 17 | 18 | -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/WEB-INF/home/root.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 |

${message}!

17 | 18 | -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/WEB-INF/home/today.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Today 14 | 15 | 16 | Hello there! All ok today ${today}? 17 | 18 | 19 | -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-xml/src/main/webapp/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-xml/src/main/webapp/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-xml/src/main/webapp/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic-xml/src/main/webapp/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/mvc-basic-xml/src/main/webapp/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | 6 | module com.apress.cems.web { 7 | requires com.apress.cems.dao; 8 | requires com.apress.cems.dj; 9 | 10 | requires java.naming; 11 | 12 | requires spring.core; 13 | requires spring.webmvc; 14 | requires spring.context; 15 | requires spring.web; 16 | 17 | requires javax.servlet.api; 18 | requires org.slf4j; 19 | requires java.annotation; 20 | requires com.zaxxer.hikari; 21 | requires spring.beans; 22 | requires java.sql; 23 | 24 | exports com.apress.cems.web.config; 25 | exports com.apress.cems.web.controllers; 26 | exports com.apress.cems.web.problem; 27 | opens com.apress.cems.web.config to spring.core; 28 | } -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems01;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password= 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/WEB-INF/home/hello.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 | Hello there ${name}! 17 | 18 | -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/WEB-INF/home/root.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 |

${message}!

17 | 18 | -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/WEB-INF/home/today.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Today 14 | 15 | 16 | Hello there! All ok today ${today}? 17 | 18 | 19 | -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic/src/main/webapp/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic/src/main/webapp/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic/src/main/webapp/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic/src/main/webapp/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-basic/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter06/mvc-basic/src/main/webapp/styles/general.css: -------------------------------------------------------------------------------- 1 | table { 2 | background-color: #FFFFE0; 3 | border-collapse: collapse; 4 | color: #000; 5 | } 6 | 7 | table thead{ 8 | background-color: #BDB76B; 9 | color: white; 10 | width: 50%; 11 | font-weight: bold; 12 | } 13 | 14 | table td { 15 | padding: 5px; 16 | border: 0; 17 | } 18 | 19 | table td { 20 | border-bottom: 1px dotted #BDB76B; 21 | } 22 | 23 | .menu{ 24 | line-height:30px; 25 | width:100px; 26 | float:left; 27 | padding:5px; 28 | } 29 | 30 | .footer{ 31 | clear:both; 32 | text-align:left; 33 | padding:10px; 34 | } 35 | 36 | .error{ 37 | border: 1px solid; 38 | margin: 10px 0px; 39 | padding:15px 10px 15px 50px; 40 | color: #D8000C; 41 | background-color: #FFBABA; 42 | } -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png 3 | name=blue -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css 2 | banner.image=/images/banner-green.png 3 | name=green -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/home.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |

19 |
20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/images/favicon.ico -------------------------------------------------------------------------------- /chapter06/mvc-thymeleaf/src/main/webapp/WEB-INF/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password= 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png 3 | name=blue -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css 2 | banner.image=/images/banner-green.png 3 | name=green -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/home.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |

19 |
20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-views/src/main/webapp/WEB-INF/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-views/src/main/webapp/WEB-INF/images/arrow-green.png -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-views/src/main/webapp/WEB-INF/images/banner-blue.png -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-views/src/main/webapp/WEB-INF/images/banner-green.png -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter06/mvc-views/src/main/webapp/WEB-INF/images/favicon.ico -------------------------------------------------------------------------------- /chapter06/mvc-views/src/main/webapp/WEB-INF/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/java/com/apress/cems/ex/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.ex; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public class ConfigurationException extends RuntimeException { 8 | public ConfigurationException(String message) { 9 | super(message); 10 | } 11 | 12 | public ConfigurationException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.0.M5) 8 | -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/static/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/boot-sec/src/main/resources/static/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/static/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/boot-sec/src/main/resources/static/images/arrow-green.png -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/static/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/boot-sec/src/main/resources/static/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/static/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/boot-sec/src/main/resources/static/images/banner-green.png -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/boot-sec/src/main/resources/static/images/favicon.ico -------------------------------------------------------------------------------- /chapter07/boot-sec/src/main/resources/static/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/java/com/apress/cems/sec/util/CurrentUser.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.sec.util; 2 | 3 | import org.springframework.core.annotation.AliasFor; 4 | import org.springframework.security.core.annotation.AuthenticationPrincipal; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * @author Iuliana Cosmina 10 | * @since 1.0 11 | */ 12 | @Target({ ElementType.PARAMETER, ElementType.ANNOTATION_TYPE }) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | @AuthenticationPrincipal 16 | public @interface CurrentUser { 17 | 18 | @AliasFor(annotation = AuthenticationPrincipal.class) 19 | boolean errorOnInvalidType() default false; 20 | 21 | @AliasFor(annotation = AuthenticationPrincipal.class) 22 | String expression() default ""; 23 | } 24 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png 3 | name=blue -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css 2 | banner.image=/images/banner-green.png 3 | name=green -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/arrow-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/banner-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/images/favicon.ico -------------------------------------------------------------------------------- /chapter07/mvc-sec-practice/src/main/webapp/WEB-INF/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/java/com/apress/cems/sec/util/CurrentUser.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.sec.util; 2 | 3 | import org.springframework.core.annotation.AliasFor; 4 | import org.springframework.security.core.annotation.AuthenticationPrincipal; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * @author Iuliana Cosmina 10 | * @since 1.0 11 | */ 12 | @Target({ ElementType.PARAMETER, ElementType.ANNOTATION_TYPE }) 13 | @Retention(RetentionPolicy.RUNTIME) 14 | @Documented 15 | @AuthenticationPrincipal 16 | public @interface CurrentUser { 17 | 18 | @AliasFor(annotation = AuthenticationPrincipal.class) 19 | boolean errorOnInvalidType() default false; 20 | 21 | @AliasFor(annotation = AuthenticationPrincipal.class) 22 | String expression() default ""; 23 | } 24 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png 3 | name=blue -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css 2 | banner.image=/images/banner-green.png 3 | name=green -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/arrow-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/banner-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/images/favicon.ico -------------------------------------------------------------------------------- /chapter07/mvc-sec-thymeleaf/src/main/webapp/WEB-INF/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems01;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/WEB-INF/home/hello.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 | Hello there ${name}! 17 | 18 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/WEB-INF/home/root.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 |

${message}!

17 | 18 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/WEB-INF/home/today.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Today 14 | 15 | 16 | Hello there! All ok today ${today}? 17 | 18 | 19 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-xml/src/main/webapp/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-xml/src/main/webapp/images/arrow-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-xml/src/main/webapp/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec-xml/src/main/webapp/images/banner-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter07/mvc-sec-xml/src/main/webapp/styles/general.css: -------------------------------------------------------------------------------- 1 | table { 2 | background-color: #FFFFE0; 3 | border-collapse: collapse; 4 | color: #000; 5 | } 6 | 7 | table thead{ 8 | background-color: #BDB76B; 9 | color: white; 10 | width: 50%; 11 | font-weight: bold; 12 | } 13 | 14 | table td { 15 | padding: 5px; 16 | border: 0; 17 | } 18 | 19 | table td { 20 | border-bottom: 1px dotted #BDB76B; 21 | } 22 | 23 | .menu{ 24 | line-height:30px; 25 | width:100px; 26 | float:left; 27 | padding:5px; 28 | } 29 | 30 | .footer{ 31 | clear:both; 32 | text-align:left; 33 | padding:10px; 34 | } 35 | 36 | .error{ 37 | border: 1px solid; 38 | margin: 10px 0px; 39 | padding:15px 10px 15px 50px; 40 | color: #D8000C; 41 | background-color: #FFBABA; 42 | } -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url=jdbc:h2:./cems01;DB_CLOSE_ON_EXIT=FALSE 3 | db.username=sa 4 | db.password=sa 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-blue.css 2 | banner.image=/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/WEB-INF/classes/green.properties: -------------------------------------------------------------------------------- 1 | css.style=/styles/decorator-green.css -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/WEB-INF/home/hello.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 | Hello there ${name}! 17 | 18 | -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/WEB-INF/home/root.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Hello 14 | 15 | 16 |

${message}!

17 | 18 | -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/WEB-INF/home/today.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: iulianacosmina 4 | Date: 2019-07-13 5 | Time: 20:49 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | 10 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 11 | 12 | 13 | Today 14 | 15 | 16 | Hello there! All ok today ${today}? 17 | 18 | 19 | -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec/src/main/webapp/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec/src/main/webapp/images/arrow-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec/src/main/webapp/images/banner-blue.png -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec/src/main/webapp/images/banner-green.png -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter07/mvc-sec/src/main/webapp/images/favicon.ico -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter07/mvc-sec/src/main/webapp/styles/general.css: -------------------------------------------------------------------------------- 1 | table { 2 | background-color: #FFFFE0; 3 | border-collapse: collapse; 4 | color: #000; 5 | } 6 | 7 | table thead{ 8 | background-color: #BDB76B; 9 | color: white; 10 | width: 50%; 11 | font-weight: bold; 12 | } 13 | 14 | table td { 15 | padding: 5px; 16 | border: 0; 17 | } 18 | 19 | table td { 20 | border-bottom: 1px dotted #BDB76B; 21 | } 22 | 23 | .menu{ 24 | line-height:30px; 25 | width:150px; 26 | float:left; 27 | padding:5px; 28 | } 29 | 30 | .footer{ 31 | clear:both; 32 | text-align:left; 33 | padding:10px; 34 | } 35 | 36 | .error{ 37 | border: 1px solid; 38 | margin: 10px 0px; 39 | padding:15px 10px 15px 50px; 40 | color: #D8000C; 41 | background-color: #FFBABA; 42 | } -------------------------------------------------------------------------------- /chapter08/boot-rest-jetty/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter08/boot-rest-jetty/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter08/boot-rest-jetty/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.0.M5) 8 | -------------------------------------------------------------------------------- /chapter08/boot-rest-practice/src/main/java/com/apress/cems/practice/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.practice.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter08/boot-rest-practice/src/main/java/com/apress/cems/practice/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.practice.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter08/boot-rest-practice/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter08/boot-rest-secured/src/main/java/com/apress/cems/secured/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | * Description: this package contains classes to implement basic authentication for REST APIs 5 | */ 6 | package com.apress.cems.secured; -------------------------------------------------------------------------------- /chapter08/boot-rest-secured/src/main/java/com/apress/cems/secured/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.secured.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter08/boot-rest-secured/src/main/java/com/apress/cems/secured/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.secured.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter08/boot-rest-secured/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter08/boot-rest-secured/src/main/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter08/boot-rest-secured/src/main/resources/keystore.jks -------------------------------------------------------------------------------- /chapter08/boot-rest-secured/src/main/resources/rest.crt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter08/boot-rest-secured/src/main/resources/rest.crt -------------------------------------------------------------------------------- /chapter08/boot-rest/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter08/boot-rest/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter08/boot-rest/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter08/rest-classic-secured/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./cems-sec;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter08/rest-classic/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./cems;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/resources/application-all.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | web: 4 | exposure: 5 | include: '*' 6 | # path-mapping: 7 | # health: salud 8 | endpoint: 9 | httptrace: 10 | enabled: true 11 | cache: 12 | time-to-live: 6000 13 | trace: 14 | http: 15 | include: remote_address, parameters 16 | -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/resources/application-none.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | web: 4 | exposure: 5 | exclude: '*' -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/resources/application-prometheus.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | web: 4 | exposure: 5 | include: '*' -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/resources/application-some.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | web: 4 | exposure: 5 | include: '*' 6 | exclude: env,beans,mapping,configprops -------------------------------------------------------------------------------- /chapter09/boot-app/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter09/boot-app/src/test/resources/application-four.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | shutdown: 4 | enabled: true 5 | endpoints: 6 | web: 7 | exposure: 8 | include: '*' 9 | exclude: env,beans,mapping,configprops 10 | -------------------------------------------------------------------------------- /chapter09/boot-app/src/test/resources/application-one.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | health: 4 | show-details: always 5 | endpoints: 6 | web: 7 | base-path: /monitoring 8 | server: 9 | port: 9091 10 | address: 0.0.0.0 11 | info: 12 | app: 13 | name: Spring Actuator Application 14 | description: This is a very simple Spring Boot Application 15 | version: 1.0-SNAPSHOT -------------------------------------------------------------------------------- /chapter09/boot-app/src/test/resources/application-three.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | web: 4 | exposure: 5 | include: '*' 6 | exclude: env,beans,mapping,configprops -------------------------------------------------------------------------------- /chapter09/boot-app/src/test/resources/application-two.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | health: 4 | show-details: always 5 | health: 6 | status: 7 | http-mapping: 8 | FATAL: 501 9 | order: FATAL, DOWN, OUT_OF_SERVICE, UNKNOWN, UP -------------------------------------------------------------------------------- /chapter09/classic-app/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter09/classic-app/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter09/classic-app/src/main/resources/db.properties: -------------------------------------------------------------------------------- 1 | # For running application with H2 in memory database 2 | db.url: jdbc:h2:./classic;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 3 | db.username: sa 4 | db.password: 5 | db.driverClassName=org.h2.Driver 6 | db.dialect=org.hibernate.dialect.H2Dialect 7 | db.hbm2ddl=create -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/test/resources/application-four.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | shutdown: 4 | enabled: true 5 | endpoints: 6 | web: 7 | exposure: 8 | include: '*' 9 | exclude: env,beans,mapping,configprops 10 | -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/test/resources/application-one.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | health: 4 | show-details: always 5 | endpoints: 6 | web: 7 | base-path: /monitoring 8 | server: 9 | port: 9091 10 | address: 127.0.0.1 11 | info: 12 | app: 13 | name: Spring Actuator Application 14 | description: This is a very simple Spring Boot Application 15 | version: 1.0-SNAPSHOT -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/test/resources/application-three.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoints: 3 | web: 4 | exposure: 5 | include: '*' 6 | exclude: env,beans,mapping,configprops -------------------------------------------------------------------------------- /chapter09/prometheus-boot-app/src/test/resources/application-two.yml: -------------------------------------------------------------------------------- 1 | management: 2 | endpoint: 3 | health: 4 | show-details: always -------------------------------------------------------------------------------- /chapter09/secured-boot-app/src/main/java/com/apress/cems/sec/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.sec.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter09/secured-boot-app/src/main/java/com/apress/cems/sec/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.sec.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter09/secured-boot-app/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter09/secured-boot-app/src/test/resources/application-one.yml: -------------------------------------------------------------------------------- 1 | info: 2 | app: 3 | name: Spring Actuator Secured Application 4 | description: This is a very simple Spring Boot Secured Application 5 | version: 1.0-SNAPSHOT -------------------------------------------------------------------------------- /chapter10/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url = uri("https://repo.spring.io/milestone") } 4 | gradlePluginPortal() 5 | } 6 | resolutionStrategy { 7 | eachPlugin { 8 | if (requested.id.id == "org.springframework.boot") { 9 | useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") 10 | } 11 | } 12 | } 13 | } 14 | rootProject.name = "kotlin" 15 | -------------------------------------------------------------------------------- /chapter10/src/main/kotlin/com/apress/cems/kotlin/CriteriaDto.kt: -------------------------------------------------------------------------------- 1 | package com.apress.cems.kotlin 2 | 3 | import java.io.Serializable 4 | import javax.validation.constraints.NotEmpty 5 | 6 | /** 7 | * @author Iuliana Cosmina 8 | * @since 1.0 9 | */ 10 | class CriteriaDto( @NotEmpty var fieldName: String = "", 11 | @NotEmpty var fieldValue: String = "", 12 | var exactMatch: Boolean = false) : Serializable { 13 | 14 | /** 15 | * Field needed just to communicate a message of no results found. 16 | */ 17 | var noResults: String? = null 18 | 19 | val isEmpty: Boolean get() = fieldName.isEmpty() && fieldValue.isEmpty() 20 | } 21 | 22 | -------------------------------------------------------------------------------- /chapter10/src/main/kotlin/com/apress/cems/kotlin/KotlinApplication.kt: -------------------------------------------------------------------------------- 1 | package com.apress.cems.kotlin 2 | 3 | import org.springframework.boot.autoconfigure.SpringBootApplication 4 | import org.springframework.boot.runApplication 5 | 6 | 7 | @SpringBootApplication 8 | class KotlinApplication 9 | 10 | fun main(args: Array) { 11 | runApplication(*args) 12 | } -------------------------------------------------------------------------------- /chapter10/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _____ 2 | / _ \ _____________ ____ ______ ______ 3 | / /_\ \\____ \_ __ \_/ __ \ / ___// ___/ 4 | / | \ |_> > | \/\ ___/ \___ \ \___ \ 5 | \____|__ / __/|__| \___ >____ >____ > 6 | ========\/|__|===============\/=====\/=====\/ 7 | :: Spring Boot :: (v2.2.0.M5) 8 | -------------------------------------------------------------------------------- /chapter10/src/main/resources/static/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter10/src/main/resources/static/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter10/src/main/resources/static/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter10/src/main/resources/static/images/arrow-green.png -------------------------------------------------------------------------------- /chapter10/src/main/resources/static/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter10/src/main/resources/static/images/banner-blue.png -------------------------------------------------------------------------------- /chapter10/src/main/resources/static/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter10/src/main/resources/static/images/banner-green.png -------------------------------------------------------------------------------- /chapter10/src/main/resources/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter10/src/main/resources/static/images/favicon.ico -------------------------------------------------------------------------------- /chapter10/src/main/resources/static/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter10/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /chapter11/detectives-server/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ________ __ __ .__ _________ .__ 2 | \______ \ _____/ |_ ____ _____/ |_|__|__ __ ____ ______ / _____/ ______________ _|__| ____ ____ 3 | | | \_/ __ \ __\/ __ \_/ ___\ __\ \ \/ // __ \ / ___/ \_____ \_/ __ \_ __ \ \/ / |/ ___\/ __ \ 4 | | ` \ ___/| | \ ___/\ \___| | | |\ /\ ___/ \___ \ / \ ___/| | \/\ /| \ \__\ ___/ 5 | /_______ /\___ >__| \___ >\___ >__| |__| \_/ \___ >____ > /_______ /\___ >__| \_/ |__|\___ >___ > 6 | \/ \/ \/ \/ \/ \/ \/ \/ \/ \/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter11/discovery-server/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | ________ .__ _________ 2 | \______ \ |__| ______ ____ _______ __ ___________ ___.__. / _____/ ______________ __ ___________ 3 | | | \| |/ ___// ___\/ _ \ \/ // __ \_ __ < | | \_____ \_/ __ \_ __ \ \/ // __ \_ __ \ 4 | | ` \ |\___ \\ \__( <_> ) /\ ___/| | \/\___ | / \ ___/| | \/\ /\ ___/| | \/ 5 | /_______ /__/____ >\___ >____/ \_/ \___ >__| / ____| /_______ /\___ >__| \_/ \___ >__| 6 | \/ \/ \/ \/ \/ \/ \/ \/ 7 | :: Spring Boot :: (2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter11/discovery-server/src/main/resources/discovery-server.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: discovery-service 4 | # Configure this Discovery Server 5 | eureka: 6 | instance: 7 | hostname: localhost 8 | client: 9 | registerWithEureka: false # do not auto-register as client 10 | fetchRegistry: false 11 | 12 | server: 13 | port: 3000 # where this discovery server is accessible 14 | waitTimeInMsWhenSyncEmpty: 0 15 | address: 0.0.0.0 16 | 17 | logging: 18 | pattern: 19 | console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" 20 | level: 21 | root: INFO 22 | org.springframework: DEBUG 23 | com.apress.cems: DEBUG 24 | -------------------------------------------------------------------------------- /chapter11/entities/src/main/java/com/apress/cems/util/FieldGroup.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * Created by iuliana.cosmina on 3/31/15. 5 | */ 6 | public enum FieldGroup { 7 | FIRSTNAME, 8 | LASTNAME, 9 | USERNAME, 10 | HIREDIN; 11 | 12 | public static FieldGroup getField(String field){ 13 | return FieldGroup.valueOf(field.toUpperCase()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /chapter11/entities/src/main/java/com/apress/cems/util/Rank.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.util; 2 | 3 | /** 4 | * @author Iuliana Cosmina 5 | * @since 1.0 6 | */ 7 | public enum Rank { 8 | TRAINEE(1), 9 | JUNIOR(2), 10 | SENIOR(3), 11 | INSPECTOR(4), 12 | CHIEF_INSPECTOR(5); 13 | 14 | private int code; 15 | 16 | Rank(int code) { 17 | this.code = code; 18 | } 19 | 20 | public int getCode() { 21 | return code; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /chapter11/entities/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Iuliana Cosmina 3 | * @since 1.0 4 | */ 5 | module com.apress.cems.entities { 6 | requires java.persistence; 7 | requires spring.context; 8 | requires java.validation; 9 | requires com.fasterxml.jackson.databind; 10 | requires com.fasterxml.jackson.core; 11 | 12 | exports com.apress.cems.base; 13 | exports com.apress.cems.person; 14 | exports com.apress.cems.detective; 15 | } -------------------------------------------------------------------------------- /chapter11/persons-server/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | __________ _________ .__ 2 | \______ \ ___________ __________ ____ ______ / _____/ ______________ _|__| ____ ____ 3 | | ___// __ \_ __ \/ ___/ _ \ / \ / ___/ \_____ \_/ __ \_ __ \ \/ / |/ ___\/ __ \ 4 | | | \ ___/| | \/\___ ( <_> ) | \\___ \ / \ ___/| | \/\ /| \ \__\ ___/ 5 | |____| \___ >__| /____ >____/|___| /____ > /_______ /\___ >__| \_/ |__|\___ >___ > 6 | \/ \/ \/ \/ \/ \/ \/ \/ 7 | :: Spring Boot :: (v2.2.4.RELEASE) 8 | -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | __ __ ___. _________ .__ .__ __ 2 | / \ / \ ____\_ |__ \_ ___ \| | |__| ____ _____/ |_ 3 | \ \/\/ // __ \| __ \ / \ \/| | | |/ __ \ / \ __\ 4 | \ /\ ___/| \_\ \ \ \___| |_| \ ___/| | \ | 5 | \__/\ / \___ >___ / \______ /____/__|\___ >___| /__| 6 | \/ \/ \/ \/ \/ \/ 7 | 8 | :: Spring Boot :: (v2.2.4.RELEASE) 9 | -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/static/images/arrow-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter11/web-client/src/main/resources/static/images/arrow-blue.png -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/static/images/arrow-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter11/web-client/src/main/resources/static/images/arrow-green.png -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/static/images/banner-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter11/web-client/src/main/resources/static/images/banner-blue.png -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/static/images/banner-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter11/web-client/src/main/resources/static/images/banner-green.png -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/chapter11/web-client/src/main/resources/static/images/favicon.ico -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/static/styles/decorator-blue.css: -------------------------------------------------------------------------------- 1 | .banner{ 2 | background: url("../images/banner-blue.png") no-repeat 0px center; 3 | height: 90px; 4 | } 5 | 6 | a:link{color:#0000FF; text-decoration:underline; font-size:14px; background:transparent;} 7 | a:hover{color:#228B22; text-decoration:underline; font-size:16px; background:transparent;} 8 | 9 | .content{ 10 | background-color: #E0F2F7; 11 | float:left; 12 | padding:10px; 13 | } 14 | 15 | .footer p { 16 | color: #0000FF; 17 | font-size: 12px; 18 | font-style: italic; 19 | } 20 | 21 | ul { 22 | list-style-image: url("../images/arrow-blue.png"); 23 | background: no-repeat 0px center; 24 | padding-left: 30px; 25 | } 26 | -------------------------------------------------------------------------------- /chapter11/web-client/src/main/resources/templates/home.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /chapter12/reactive-boot-hybrid/src/main/java/com/apress/cems/reactive/person/PersonReactiveService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.reactive.person; 2 | 3 | import com.apress.cems.person.Person; 4 | import reactor.core.publisher.Flux; 5 | import reactor.core.publisher.Mono; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface PersonReactiveService { 12 | 13 | Mono findById(Long id); 14 | 15 | Flux findAll(); 16 | 17 | Mono save(Mono personMono); 18 | 19 | Mono update(Long id, Mono personMono); 20 | 21 | Mono delete(Long id); 22 | } 23 | -------------------------------------------------------------------------------- /chapter12/reactive-boot-hybrid/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | __________ __ .__ ___ ___ ___. .__ .___ 2 | \______ \ ____ _____ _____/ |_|__|__ __ ____ / | \ ___.__.\_ |_________|__| __| _/ 3 | | _// __ \\__ \ _/ ___\ __\ \ \/ // __ \ / ~ < | | | __ \_ __ \ |/ __ | 4 | | | \ ___/ / __ \\ \___| | | |\ /\ ___/ \ Y /\___ | | \_\ \ | \/ / /_/ | 5 | |____|_ /\___ >____ /\___ >__| |__| \_/ \___ > \___|_ / / ____| |___ /__| |__\____ | 6 | \/ \/ \/ \/ \/ \/ \/ \/ \/ 7 | :: Spring Boot :: (v2.2.0.M5) 8 | -------------------------------------------------------------------------------- /chapter12/reactive-boot-kinda/src/main/java/com/apress/cems/reactive/person/PersonReactiveService.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.reactive.person; 2 | 3 | import com.apress.cems.person.Person; 4 | import reactor.core.publisher.Flux; 5 | import reactor.core.publisher.Mono; 6 | 7 | /** 8 | * @author Iuliana Cosmina 9 | * @since 1.0 10 | */ 11 | public interface PersonReactiveService { 12 | 13 | Mono findById(Long id); 14 | 15 | Flux findAll(); 16 | 17 | Mono save(Mono personMono); 18 | 19 | Mono update(Long id, Mono personMono); 20 | 21 | Mono delete(Long id); 22 | } 23 | -------------------------------------------------------------------------------- /chapter12/reactive-boot-kinda/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | __________ __ .__ ____ __.__ .___ 2 | \______ \ ____ _____ _____/ |_|__|__ __ ____ | |/ _|__| ____ __| _/____ 3 | | _// __ \\__ \ _/ ___\ __\ \ \/ // __ \ | < | |/ \ / __ |\__ \ 4 | | | \ ___/ / __ \\ \___| | | |\ /\ ___/ | | \| | | \/ /_/ | / __ \_ 5 | |____|_ /\___ >____ /\___ >__| |__| \_/ \___ > |____|__ \__|___| /\____ |(____ / 6 | \/ \/ \/ \/ \/ \/ \/ \/ \/ 7 | :: Spring Boot :: (v2.2.0.M5) 8 | -------------------------------------------------------------------------------- /chapter12/reactive-boot-mongo/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | data: 3 | mongodb: 4 | host: 127.0.0.1 5 | port: 27017 6 | server: 7 | port: 8081 8 | servlet: 9 | context-path: / 10 | compression: 11 | enabled: true 12 | address: 0.0.0.0 13 | management: 14 | endpoints: 15 | web: 16 | exposure: 17 | include: 'beans,health' 18 | 19 | endpoint: 20 | health: 21 | show-details: always 22 | 23 | logging: 24 | pattern: 25 | console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" 26 | level: 27 | root: INFO 28 | org.springframework: DEBUG 29 | com.apress.cems.reactive: DEBUG -------------------------------------------------------------------------------- /chapter12/reactive-boot-mongo/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | logging: 2 | pattern: 3 | console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" 4 | level: 5 | root: INFO 6 | org.springframework: INFO 7 | com.apress.cems.mongo: DEBUG 8 | 9 | spring: 10 | data: 11 | mongodb: 12 | host: 127.0.0.1 13 | port: 12345 -------------------------------------------------------------------------------- /chapter12/reactive-boot-r2dbc/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | h2: 3 | console: 4 | enabled: true 5 | 6 | management: 7 | endpoints: 8 | web: 9 | exposure: 10 | include: 'beans,health' 11 | 12 | endpoint: 13 | health: 14 | show-details: always 15 | 16 | logging: 17 | pattern: 18 | console: "%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n" 19 | level: 20 | root: INFO 21 | org.springframework: INFO 22 | org.springframework.data.r2dbc.connectionfactory: DEBUG 23 | com.apress.cems.boot: DEBUG 24 | io.r2dbc.h2: INFO 25 | h2database: WARN -------------------------------------------------------------------------------- /chapter12/reactive-boot-r2dbc/src/test/java/com/apress/cems/r2dbc/TestBase.java: -------------------------------------------------------------------------------- 1 | package com.apress.cems.r2dbc; 2 | 3 | import com.apress.cems.r2dbc.person.Person; 4 | 5 | import java.time.LocalDateTime; 6 | 7 | public class TestBase { 8 | 9 | protected Person createPerson(Long id, String loginuser, String sherlock, String holmes, String dudu) { 10 | Person person = new Person(); 11 | person.setId(id); 12 | person.setLoginuser(loginuser); 13 | person.setFirstname(sherlock); 14 | person.setLastname(holmes); 15 | person.setPassword(dudu); 16 | person.setHiringdate(LocalDateTime.now()); 17 | return person; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/cover.jpg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Apress/pivotal-certified-pro-spring-dev-exam-02/1fc4473e0047ddd0dd5ace9e60896e807080ef20/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | --------------------------------------------------------------------------------