This session will give attendees an overview of the new testing features in Spring 3.1 as well the new Spring MVC test support. Sam Brannen will demonstrate how to use the Spring TestContext Framework to write integration tests for Java-based Spring configuration using @Configuration classes. He'll then compare and contrast this approach with XML-based configuration and follow up with a discussion of the new testing support for bean definition profiles. Next, Rossen Stoyanchev will show attendees how testing server-side code with annotated controllers and client-side code with the RestTemplate just got a whole lot easier with the new Spring MVC test support. Come to this session to see these new Spring testing features in action and learn how you can get involved in the Spring MVC Test Support project.
Common issues with Apache Kafka® Producerconfluent
Badai Aqrandista, Confluent, Senior Technical Support Engineer
This session will be about a common issue in the Kafka Producer: producer batch expiry. We will be discussing the Kafka Producer internals, its common causes, such as a slow network or small batching, and how to overcome them. We will also be sharing some examples along the way!
https://www.meetup.com/apache-kafka-sydney/events/279651982/
New Generation Oracle RAC 19c focuses on diagnosing Oracle RAC performance issues. The document discusses tools used by Oracle's RAC performance engineering team to instrument and measure key code areas between releases. It also covers how Oracle RAC provides high availability and scalability for workloads like traditional apps, new apps, IoT workloads, and more. Diagnosing performance requires understanding factors like private network latency and configuration.
- Understanding Time Series
- What's the Fundamental Problem
- Prometheus Solution (v1.x)
- New Design of Prometheus (v2.x)
- Data Compression Algorithm
※다운로드하시면 더 선명한 자료를 보실 수 있습니다.
PAYCO 쇼핑의 아키텍처를 MSA로 변경하면서 겪은 삽질을 공유합니다.
레거시 서비스에서 서비스를 분리해내는 방법과 순서, 이후 고려해야 할 사항을 공유하고자 합니다.
목차
1. PAYCO 쇼핑?
2. 프로젝트 진행 과정
3. 아키텍처 공유
대상
- MSA, Spring cloud, Docker, Ansible 등을 실무에 적용하는 방법에 관심이 있는 분
- Spring Cloud를 써서 MSA로 개발하고 싶은데 어디서부터 손대야 할지 모르는 분
■관련 동영상: https://youtu.be/l195D5WT_tE
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Miguel Araújo
MySQL InnoDB ClusterSet brings multi-datacenter capabilities to our solutions and make it very easy to setup a disaster recovery architecture. Think multiple MySQL InnoDB Clusters into one single database architecture, fully managed from MySQL Shell and with full MySQL Router integration to make it easy to access the entire architecture.
This presentation covers:
- The various features of InnoDB Clusterset
- How to setup MySQL InnoDB ClusterSet
- Ways to migrate from an existing MySQL InnoDB Cluster into MySQL InnoDB ClusterSet
- How to deal with various failures
- The various features of router integration which makes connection to the database architecture easy.
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
This document provides an overview and comparison of MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet. It discusses the components, goals, and features of each solution. MySQL InnoDB Cluster uses Group Replication to provide high availability, automatic failover, and data consistency. MySQL InnoDB ReplicaSet uses asynchronous replication and provides availability and read scaling through manual primary/secondary configuration and failover. Both solutions integrate MySQL Shell, Router, and automatic member provisioning for easy management.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
This presentation:
* covers basics of caching and popular cache types
* explains evolution from simple cache to distributed, and from distributed to IMDG
* not describes usage of NoSQL solutions for caching
* is not intended for products comparison or for promotion of Hazelcast as the best solution
ProxySQL High Avalability and Configuration Management OverviewRené Cannaò
The document provides an overview of high availability and configuration management options for ProxySQL. It discusses deploying ProxySQL locally on application servers, in a dedicated layer, or using both approaches. When deploying in a dedicated layer, options for high availability include keepalived, load balancers, Consul, and Kubernetes. Configuration can be managed through tools like Ansible, Puppet, or by loading SQL files. ProxySQL Cluster enables syncing configuration across nodes.
Orchestrator allows for easy MySQL failover by monitoring the cluster and promoting a new master when failures occur. Two test cases were demonstrated: 1) using a VIP and scripts to redirect connections during failover and 2) integrating with Proxysql to separate reads and writes and automatically redirect write transactions during failover while keeping read queries distributed. Both cases resulted in failover occurring within 16 seconds while maintaining application availability.
This document provides an overview of PostgreSQL and instructions for installing and configuring it. It discusses using the initdb command to initialize a PostgreSQL database cluster and create the template1 and postgres databases. It also explains that the template1 database serves as a template that is copied whenever new databases are created.
Building Workflow Applications Through the WebT. Kim Nguyen
This document discusses building workflow apps through Plone. It describes what workflow apps are, why they are useful, and how to create them using PloneFormGen, the Data to Content adapter, and the Workflow Manager without coding. It provides a walkthrough of building a sample travel expense form workflow app and discusses future plans to improve the process of creating workflow apps through Plone.
http://www.opitz-consulting.com/go/3-5-898
Smartphones haben unsere Welt im Schnellgang erobert. Die Tablets folgen nicht minder schnell nach. Was fasziniert uns so daran? Welche neuen Möglichkeiten bieten sich für das Business? Welchen Einfluss wird das allgegenwärtige HTML5 haben? Wie bekomme ich mobile Lösungen architektonisch optimal in meine SOA-Landschaft integriert, und welche Vorteile gewinne ich bei der Prozessautomatisierung? Diese Session liefert sowohl einen Überblick als auch Antworten für eine neue Klasse von Architekturfragen.
Die SOA-Experten Torsten Winterberg und Guido Schmutz hielten diesen Fachvortrag bei der DOAG Konferenz und Ausstellung am 20.11.2013 in Nürnberg.
--
Über uns:
Als führender Projektspezialist für ganzheitliche IT-Lösungen tragen wir zur Wertsteigerung der Organisationen unserer Kunden bei und bringen IT und Business in Einklang. Mit OPITZ CONSULTING als zuverlässigem Partner können sich unsere Kunden auf ihr Kerngeschäft konzentrieren und ihre Wettbewerbsvorteile nachhaltig absichern und ausbauen.
Über unsere IT-Beratung: http://www.opitz-consulting.com/go/3-8-10
Unser Leistungsangebot: http://www.opitz-consulting.com/go/3-8-874
Karriere bei OPITZ CONSULTING: http://www.opitz-consulting.com/go/3-8-5
The document discusses JRuby on Google App Engine, including key features of App Engine, quotas and billing, limitations, the current issues with JRuby on App Engine, App Engine gems, the development environment, deployment process, APIs, and milestones in the development of JRuby on App Engine. It also includes a short biography and discussion of learning experiences from building an iPhone app that uses App Engine and JRuby as a backend.
This tutorial teaches how to customize forms in PerfectForms by:
1. Creating and naming a new form, then setting its size, borders, and background color in the Form Properties panel.
2. Adding images to the form by selecting them from the assets menu in the toolbar and adjusting their size and position.
3. Creating accent borders using horizontal and vertical separators from the toolbar, then customizing their color, width, and position on the form.
4. Saving and previewing the customized form.
Lincs Business networking presentationMalcolm York
The document provides an agenda and details for a BizMidlands networking event on June 29th, 2011. The agenda includes introductions, presentations on marketing topics, and speed networking sessions. Additional details provide background on BizMidlands as a networking group for businesses across several Midlands regions in the UK. The document promotes upcoming events like a business conference and encourages attendees to get involved through the group's website and social media platforms.
This document provides an overview guide for newcomers to Fredericton, New Brunswick. It includes sections on living in Fredericton which discusses housing, transportation, healthcare, education and recreation. It also covers working and studying in Fredericton, immigrating to Fredericton, and includes useful contact information for various municipal services. The guide welcomes newcomers and provides concise information on essential topics to assist with relocating to and settling in Fredericton.
Participant driven professional development that is collaborative rather than competitive,
promotes sharing of best practices: grass-roots innovation, teacher to teacher, educator to educator, student to student, parent to parent, one to another, one to each other, inclusive rather than exclusive, and with everyone joined in a common endeavour. All of this can be enhanced through the use of technology, leveraged for maximum engagement across time, distance and space (but not the most critical element)..
There are those who say that education will only get better if teachers get better. The way to do that, across the globe, is for those of us whose minds, hearts, and souls are thusly engaged, is to share, and to care... The rest will take care of itself if we do this one thing: share & care... There will be no obstacle that is capable of resisting the force of millions, no billions of people, who have determined that in the end, changing the status quo is within our will to effect it, one by one and two by two, relentlessly.
That is the grass-roots power of EdCamps all over the world... Be the change you want to see in education, and it will be so, sooner rather than later...
Este documento apresenta um resumo sobre abelhas brasileiras, incluindo sua classificação, morfologia e identificação. O livro fornece chaves para a identificação de todos os gêneros de abelhas encontrados no Brasil, além de informações sobre sua sistemática, biologia, ecologia e distribuição geográfica.
The document discusses the Mexican Muralist movement, which emerged after the Mexican Revolution. It was characterized by large-scale fresco paintings on public buildings that captured Mexican history, culture, and social struggles. The three main exponents were José Clemente Orozco, David Alfaro Siqueiros, and Diego Rivera, who incorporated indigenous styles and socialist ideals into their monumental works depicting the Mexican people and landscape.
Apps for Office allow developers to create apps that integrate with Office applications like Word, Excel, PowerPoint, and Outlook, bringing SharePoint content and functionality into the Office experience. Developers can build task pane apps, which appear as panels in Office applications, and content apps, which are embedded directly into documents. These apps provide opportunities to enhance collaboration and workflows by supplementing documents with SharePoint features and third-party services.
The document provides information about the elected student body, called the Gymkhana Union Body, at the National Institute of Technology Silchar. It lists the office bearers for the 2015-2016 session, including the President, Vice President, General Secretary, Cultural Secretary, Sports Secretary, Literary Secretary, and others. The Gymkhana Union Body looks after various student activities and plans for the betterment of the college. NIT Silchar has a tradition of holding elections every year to elect representatives to the Gymkhana Union Body.
This document provides an overview of Arisu, Seoul's brand of tap water. It discusses the history of tap water in Seoul, from a time when water had to be transported into the city, to the current system that provides safe drinking water to over 10 million people daily. It outlines Seoul's policies and technologies to ensure water quality, including comprehensive management of water sources, advanced purification technologies, and optimization of the water supply system using IT. The document highlights how Seoul has strengthened its tap water management over time to provide residents with the safest and highest quality drinking water in the world.
Talk at LBi "What's next in UX design",February 2012
In the past designers made products useful, usable and delightful. If we adhered to these principles we believed products would sell. The business factors were mostly external to the product. Now the business model is an integral requirement that shapes digital design.
The consumer electronic products we used to own were the embodiment of access to entertainment, personal media and communication. The past decade witnessed the demise of products we own to the explosion of services, enabled by the internet, we use. Value perceptions are shifting from ownership towards seamless accessibility and habitual choice. Technology convergence affords ever new interactions between context, content and social relationships and consequently value perceptions are in perpetual flux. We've become aware, in retrospect, that business models driven by the internet and reacting to this flux seem to follow evolutionary tendencies.
- A look at a brief history of business models on the internet affected by evolutionary forces.
- Is it all about the survival of the fittest? And are there successful niche opportunities?
- Although evolution is inherently non-deterministic it doesn't harm to ask the question: what lies ahead and where are we going? Can products and services be designed to become more adaptive to evolutionary requirements?
IBM Connections Adminblast - Connect17 (DEV 1268)Nico Meisenzahl
Buckle up, join Christoph and Nico and get ready to learn 50 tips and tricks you can implement right away to improve your IBM Connections environment. Your users will thank you as they too benefit from this best practice list gathered from real-world projects while deploying and administering IBM Connections On-premises. Walk away with knowledge covering anything from Cognos integration, docs, CCM and Forms Experience Builder to the back end and DB2, TDI and SSO.
The document discusses using interactive emails to engage users by having them reply with simple responses, like how their day went, and saving those replies to their account without needing to visit the website. It provides tips for interactive emails, such as making the initial action very simple, breaking tasks into small steps, having a low threshold for success, keeping users interested with variety, and gathering feedback when users fail or disengage. The overall strategy is to gradually engage users in an easy way through familiar email interactions.
Hiromu Shioya gave a lightning talk about being born in and connected by the internet. He shared several links to book recommendations on his website about various technical topics such as PHP, web development, and computer networking. The talk concluded by providing a link to apply for jobs at his company.
The document contains details of 18 companies including their names, CEO/Director names and contact details like email, phone numbers and addresses. Some key details are:
- Hical Technologies Pvt. Ltd. and Hical Magnetics Pvt Ltd have the same CEO, Shashikiran Mallur.
- American Power Conversion (I) Pvt. Ltd. has two locations and the same CEO, Javed Ahmad.
- Kaynes Technology CEO is Ramesh Kannan and they are located in Mysore.
- Contact details provided include names, designations, email IDs and phone numbers of CEOs, CFOs and other contacts.
Testing Web Apps with Spring Framework 3.2Sam Brannen
This document provides an overview of the new testing features in the Spring Framework 3.2, including the Spring TestContext Framework and the new Spring MVC Test Framework. The Spring TestContext Framework allows for annotation-driven unit and integration testing of Spring-managed components. It supports loading application contexts, dependency injection of test instances, and transactional test management. The new Spring MVC Test Framework enables server-side testing of Spring MVC applications without requiring a servlet container. It provides a fluent API for building mock requests and asserting mock responses. The framework also supports testing client-side interactions using the RestTemplate.
S313352 optimizing java device testing with automatic feature discoveringromanovfedor
The document discusses optimizing Java device testing by using diagnostic tests to automatically discover a device's capabilities. Diagnostic tests check if optional features are supported and export the results. This reduces the time needed to configure tests from days to 30 minutes by avoiding tests that don't apply. The solution was implemented in the Java Device Test Framework (JDTF) by marking diagnostic tests, writing tests to check features and export results, and adjusting relevance filters. A demo showed how diagnostic tests streamline test configuration.
This document provides an introduction to Spring Boot, including its objectives, key principles, and features. It discusses how Spring Boot enables building standalone, production-grade Spring applications with minimal configuration. It demonstrates creating a "Hello World" REST app with one Java class. It also covers auto-configuration, application configuration, testing, supported technologies, case studies, and other features like production readiness and remote shell access.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
Presented on Feb 21, 2013 as part of a springsource.org webinar. A video of the presentation will be available 2 weeks later at http://www.youtube.com/springsourcedev.
This document provides an overview of Spring Boot, a framework for creating stand-alone, production-grade Spring based applications. It discusses how Spring Boot aims to make it easy to create Spring applications with default configurations and minimal code. The key topics covered include: using Maven and Gradle build tools with Spring Boot, common features and conventions like auto-configuration and main application classes, Spring Data and JPA for database access, Spring MVC features for web applications, and testing Spring applications.
This document provides an overview and introduction to Spring Boot. It discusses:
- The goals of Spring Boot to provide a faster setup process and default configurations without needing XML.
- Key features like auto-configuration, embedded servlet containers, and the use of starters for common dependencies.
- Conventions for project structure, main application classes, and defining beans.
- How to configure databases, implement JPA repositories, and build REST APIs with Spring MVC and data REST.
- Tips for testing Spring applications and building executable JAR files for deployment.
This document provides an overview and introduction to Spring Boot. It discusses:
- The goals of Spring Boot to provide a faster setup process and default configurations without needing XML.
- Key features like auto-configuration, embedded servlet containers, and the use of starters for common dependencies.
- Conventions in Spring Boot for project structure, main classes, configuration properties, and more.
- How to set up a Spring Boot project using Maven, including using the spring-boot-starter-parent and starter POMs.
- Support in Spring Boot for Spring MVC, data access with JPA/Spring Data, REST services, and testing.
The document provides an introduction to JUnit testing in Java. It discusses how to set up a JUnit test with the AEM testing framework using the AemContextExtension. Key aspects covered include adding Sling models to the test context, loading mock JSON resources, and adapting requests to test Sling models. The anatomy of a JUnit test is explained with examples of setting up mocks, verifying expectations, and asserting results. Mocking and the Mockito framework are also introduced for simulating dependencies in tests.
This document discusses different approaches to dependency injection in Scala, especially for use with Play!. It evaluates Spring, Spring-Scala, CDI, Guice, SubCut and Cake based on criteria like idiomatic Scala usage, testing support, and fit with Play!. Spring-Scala is recommended for projects that need to integrate Java and Scala code. Guice and Cake are recommended for standalone Scala projects. Cake provides additional type safety while Guice and Cake are good options for Play! projects.
This document provides an overview of the Spring framework. Some key points:
- Spring promotes loose coupling and separation of concerns through its lightweight container and use of dependency injection.
- It simplifies configuration for aspects like transactions through declarative programming without needing full J2EE.
- The inversion of control container resolves and "injects" dependencies into components.
- Spring supports aspects through its aspect-oriented programming features which allow cross-cutting concerns to be implemented as aspects.
- It provides transaction management, DAO support, and metadata support to further simplify programming tasks.
Spring 3 emphasizes annotation configuration over XML. Key changes include support for JSR 250, 299/330, and 303 annotations as well as a simplified MVC framework with @Controller and @RequestMapping annotations. Validation is integrated using JSR 303 annotations and executed automatically by the framework. Configuration is also simplified through @Configuration classes and the @Bean annotation.
Automation testing involves recording user actions on an application and verifying its behavior. Quick Test Professional (QTP) is an automation testing tool that follows a 7 step process: 1) preparing the test environment; 2) recording user actions; 3) enhancing the test with checkpoints and parameters; 4) debugging the test; 5) running the test; 6) analyzing results; and 7) reporting defects. QTP allows dividing tests into logical units called actions to make tests more modular and reusable across multiple tests.
Quick Test Professional (QTP) is automation testing tool that allows testing of applications by automating common tasks like recording, playback, and validating results. The QTP testing process involves 7 main phases including preparing the test environment, recording tests, enhancing tests with parameters and checkpoints, running tests, and analyzing results. QTP uses objects, actions, checkpoints and other features to model tests at different levels of the application under test. Test results can be stored and reported using features like the object repository, test reports and integration with other tools.
This document provides instructions for using the TestLink Integrator tool to update test case statuses in TestLink from automated tests executed in TestNG. The tool listens for test results from TestNG tests, identifies the associated TestLink test case IDs, and updates the statuses in TestLink. It requires configuring a TestLink project with a test plan and build, marking test cases as automated, and setting the TestLink ID in each TestNG test method. The document outlines the setup and configuration needed to use the tool to integrate TestLink and TestNG test automation.
This document discusses Spring Framework's support for dependency injection and annotation-driven configuration. It explains how to define Spring components using annotations like @Component and qualify dependencies using @Autowired and @Qualifier. It also covers how to configure beans declaratively using Java configuration classes and factory methods annotated with @Bean. The document discusses how Spring scans for components, injects dependencies, and manages bean lifecycles using callbacks annotated with @PostConstruct and @PreDestroy. It also describes how to define profiles to conditionally enable beans and configure the environment.
Java annotations allow metadata to be added to Java code elements like classes, methods, and fields. This metadata can be read by tools and libraries to affect how the code is processed. Common built-in annotations include @Deprecated, @Override, and @SuppressWarnings. Annotations can also be applied to other annotations to specify how they function, such as their retention policy or valid targets. As an example, the document describes how to build a simple annotation-based test framework using the @Test annotation to mark test methods.
Testing with JUnit 5 and Spring - Spring I/O 2022Sam Brannen
This session will give you an overview of the latest and greatest in the world of testing using JUnit Jupiter (a.k.a. JUnit 5) and the Spring Framework.
The focus will be major new features in JUnit Jupiter 5.8 and 5.9 as well as recent and upcoming enhancements to Spring's integration testing support.
CDI (Contexts and Dependency Injection) is the Java standard for dependency injection and interception. It simplifies and standardizes the API for DI and AOP similar to how JPA did for ORM. CDI uses annotations like @Inject and @Produces to manage dependencies between classes and allows for features like interceptors and decorators. While part of Java EE, CDI can also be used outside of a Java EE container.
Similar to Spring 3.1 and MVC Testing Support (20)
Testing with Spring, AOT, GraalVM, and JUnit 5 - Spring I/O 2023Sam Brannen
Attend this talk to learn about the latest and greatest in the world of testing using the Spring Framework and JUnit Jupiter (a.k.a. JUnit 5) including tips for testing with Spring AOT and GraalVM native images.
Join core JUnit 5 committer Sam Brannen to gain insight on the latest new features in JUnit 5 as well as what’s on the horizon.
In this presentation we will look at exciting new features that have been added in JUnit 5 over the past year, including temporary directories, custom display name generators, method ordering, timeouts, the Test Kit, and powerful new extension APIs. If you haven't yet made the switch from JUnit 4 to JUnit 5 you will definitely want to check out this presentation.
In closing, Sam will also provide a few tips on how to use JUnit Jupiter to test Spring and Spring Boot apps.
JUnit 5: What's New and What's Coming - Spring I/O 2019Sam Brannen
Join core JUnit 5 committer Sam Brannen to gain insight on the latest new features in JUnit 5 as well as what’s on the horizon.
Sam will also provide tips on how to best use JUnit Jupiter to test Spring and Spring Boot apps.
JUnit 5 - New Opportunities for Testing on the JVMSam Brannen
Take a Deep Dive into JUnit 5 with core committer Sam Brannen!
Over the last decade a lot has happened in the world of Java and testing, but JUnit 4 hasn't kept up. Now JUnit 5 is here to help shape the future of testing on the JVM with a focus on Java 8 language features, extensibility, and a modern programming API for testing in Java. Moreover, JUnit isn't just a Java testing framework anymore. Third parties are already developing test engines for Scala, Groovy, Kotlin, etc. that run on the new JUnit Platform.
This session starts off with an overview of the inspiration for & architecture of JUnit 5, from launchers to test engines. Sam will then take the audience on a live coding tour, highlighting support for tagging, custom display names, dependency injection, repeated tests, parameterized tests, conditional test execution, lambda expressions for assertions, assumptions, & dynamic tests, and implementing tests via interface default methods (a.k.a., testing traits).
Next, Sam will present the new extension model in JUnit Jupiter, discussing how to author and register extensions for conditional tests, parameter resolution (a.k.a., dependency injection), lifecycle callbacks, & more.
To round off the session, Sam will quickly showcase the new JUnit Jupiter support in Spring Framework 5.0.
Get the Most out of Testing with Spring 4.2Sam Brannen
Join Sam Brannen and Nicolas Fränkel to discover what's new in Spring Framework 4.2's testing support and learn tips and best practices for testing modern, Spring-based applications.
Sam Brannen is the Spring Test component lead and author of the Spring TestContext Framework, and Nicolas Fränkel is the author of the book "Integration Testing from the Trenches".
In this session, Sam and Nicolas will cover the latest testing features in Core Spring, Spring Boot, and Spring Security. In addition to new features, they will also present insider tips and best practices on integration testing with suites in TestNG, database transactions, SQL script execution, granularity of context configuration files, optimum use of the context cache, a discussion on TestNG vs. JUnit, and much more.
JUnit 5 - from Lambda to Alpha and beyondSam Brannen
Want to know what the hype surrounding JUnit 5 is all about? Then join this talk by JUnit 5 core committer Sam Brannen to find out!
Since JUnit 4.0 was first released, a lot has happened in the world of Java. Unfortunately, JUnit 4 hasn't kept up with the times. JUnit 5 therefore aims to help shape the future of testing on the JVM, with a focus on Java 8, modularity, extensibility, and a modern programming API for authoring tests in Java.
This presentation will start off by providing attendees an overview of the inspiration for and architecture of JUnit 5, from launchers to test engines. Sam will then take the audience on an example-driven tour of the new programming model, highlighting support for dependency injection via flexible method signatures, conditional test execution, using lambda expressions and method references in assertions and assumptions, and implementing test/before/after methods via interface default methods.
To round off the discussion, Sam will present an overview of the new extension model in JUnit 5, discussing how to author and register extensions for conditional tests, method parameter resolution, lifecycle callbacks, and more.
The Spring Framework has always embraced testing as a first class citizen. Spring-based components should be modular, easy to wire together via dependency injection, and therefore easy to test. In fact, when well designed following a POJO programming model, a component in a Spring application can be unit tested without using Spring at all. And when you take the step toward developing integration tests, Spring's testing support is there to make your job easy.
Join Spring Test component lead Sam Brannen in this talk to learn about the basics for Spring's unit and integration testing support. This talk will provide attendees an overview of the following topics: unit testing without Spring, integration testing with Spring, loading application contexts (with and without context hierarchies), injecting dependencies into tests, transaction management for tests, SQL script execution, testing Spring MVC and REST web applications, and more.
The Spring Framework has undergone a lot of innovation in the 4.0 and 4.1 releases, and so has its testing support. Join Spring Test component lead Sam Brannen in this talk to discover what's new in Spring's testing support in 4.0 through 4.1.
This talk will provide attendees an overview of what's been deprecated, what's changed, and what's been introduced in Spring's testing support over the last two years, with real life examples and tips for best practices. Highlights include using SocketUtils to scan for free TCP & UDP server ports, the ActiveProfilesResolver API, meta-annotation support for test annotations including attribute overrides, best practices with TestNG, using Groovy scripts to configure an ApplicationContext for integration tests, improvements to SQL script execution and embedded databases, the new TestContext framework bootstrap strategy, programmatic transaction management in tests, and more.
Spring Framework 4.1 is the latest release of the popular open source application framework for Java developers with continued innovation for Java SE 8 and enterprise Java. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models and testing features.
Specifically, this talk will cover support for annotation-driven JMS listeners, JMS 2.0's shared subscriptions, JCache (JSR-107) annotations, a compiler mode for the Spring Expression Language (SpEL), flexible resolution and transformation of static web resources, and Web MVC support for Groovy markup templates.
The presentation also provides an overview of Spring 4.1's refinements in other areas, for example: Java 8's Optional type for injection points, declarative MVC view resolution, Jackson's JsonView, WebSocket scope, SockJS client support, declarative SQL scripts and programmatic transactions in the TestContext framework, integration testing with Groovy scripts, and more.
Testing Spring MVC and REST Web ApplicationsSam Brannen
This document provides an overview of testing Spring MVC web applications. It discusses the Spring TestContext Framework and how it can be used to load a WebApplicationContext for testing. It also covers the Spring MVC Test Framework, which provides a fluent API for testing MVC controllers without requiring a servlet container. Both server-side testing of MVC controllers and client-side testing of REST services using RestTemplate are demonstrated. The presentation concludes with resources for learning more about testing Spring applications.
Composable Software Architecture with SpringSam Brannen
Sam Brannen gave a presentation on composable software architecture with Spring. He discussed how modern enterprise applications need to interact with multiple external systems and services. A composable architecture uses modular, stateless components that can be assembled in different combinations. Spring supports this through features like dependency injection, inversion of control, and its ecosystem of projects. The roadmap for Spring 4.0 includes better support for Java 8, configuring Spring with Groovy, and key Java EE 7 technologies.
Spring Framework 4.0 is the latest generation of the popular open source framework for Enterprise Java developers, focusing on the future with support for Java SE 8 and Java EE 7. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models made possible with the adoption of JDK 8 language features and APIs.
Specifically, this talk will cover support for lambda expressions and method references against Spring callback interfaces, JSR-310 Date-Time value types for Spring data binding and formatting, Spring's new @Conditional mechanism for activation of bean definitions, and a new WebSocket endpoint model. The presentation also provides an overview of Spring 4.0's updated support for enterprise APIs such as JMS 2.0, JPA 2.1, Bean Validation 1.1, Servlet 3.1, and JCache. Last but not least, Sam will highlight some of the major themes for the upcoming Spring Framework 4.1 release such as support for JCache 1.0 annotations, annotation-driven JMS listeners, and testing improvements.
Spring Framework 4.0 - The Next Generation - Soft-Shake 2013Sam Brannen
Spring Framework 4.0 is the next generation of the popular open source framework for Enterprise Java developers, focusing on the future with support for Java SE 8 and Java EE 7. In this presentation core Spring committer Sam Brannen will provide attendees an overview of the new enterprise features in the framework as well as new programming models made possible with the adoption of JDK 8 language features and APIs.
Specifically, this talk will cover support for lambda expressions and method references against Spring callback interfaces, JSR-310 Date-Time value types for Spring data binding and formatting, Spring's new @Conditional mechanism for activation of bean definitions, and a new WebSocket endpoint model. Regarding enterprise APIs, the presentation will cover Spring 4.0's new support for JMS 2.0, JPA 2.1, Bean Validation 1.1, Servlet 3.1, JCache, and JSR-236 concurrency. Last but not least, Sam will discuss improvements to Spring's testing support and point out which deprecated APIs have been pruned from the framework.
As the leading full-stack application framework for Java SE and EE, the Spring Framework continues to deliver significant benefits to Java developers, increasing development productivity and runtime performance while improving test coverage and application quality.
In this talk, core Spring Framework committer Sam Brannen will provide attendees an overview of the new features in Spring 3.2 as well as a sneak peak at the roadmap for 4.0.
Spring Framework 3.2 builds on several themes delivered in 3.1 with a continued focus on asynchronous MVC processing with Servlet 3.0, support for using @Autowired and @Value as meta-annotations, support for custom @Bean definition annotations, and early support for JCache 0.5. Regarding the internals, CGLIB 3.0 and ASM 4.0 have been inlined, and the framework is now built with Gradle and hosted on GitHub. For those interested in testing their Spring-based web applications, Spring 3.2 offers new support for loading WebApplicationContexts in the TestContext framework, and the formerly standalone Spring MVC Test project is now included in the spring-test module, allowing for first-class testing of Spring MVC applications.
Spring 3.1 and MVC Testing Support - 4DevelopersSam Brannen
Please note that this presentation is an abridged version of the one given by Rossen Stoyanchev and me at SpringOne 2GX 2012.
This session will give attendees an overview of the new testing features in Spring 3.1 as well the new Spring MVC test support. Sam Brannen will demonstrate how to use the Spring TestContext Framework to write integration tests for Java-based Spring configuration using @Configuration classes. He'll then compare and contrast this approach with XML-based configuration and follow up with a discussion of the new testing support for bean definition profiles. Next, attendees will see how testing server-side code with annotated controllers and client-side code with the RestTemplate just got a whole lot easier with the new Spring MVC test support. Come to this session to see these new Spring testing features in action.
Modern application frameworks promote a POJO-based programming model, and POJOs are inherently easy to unit test. But how can we effectively integration test our application outside the container while still getting as close to a production-like environment as possible? This session will show attendees how to approximate a target production environment using JUnit and the Spring TestContext Framework to drive fast, repeatable, "out-of-container" integration tests. To simulate a live system, the session will cover open source integration testing techniques such as the use of in-memory databases, JMS providers, and Servlet containers as well as mock SMTP and FTP servers. These techniques are not limited to Spring based applications and can be applied to help integration test any modern Java application.
Spring 3.1 to 3.2 in a Nutshell - SDC2012Sam Brannen
Spring 3.1 introduced several eagerly awaited features including bean definition profiles (a.k.a., environment-specific configuration), enhanced Java-based application and infrastructure configuration (a la XML namespaces), and a new cache abstraction. This session will provide attendees a high-level overview of these major new features plus a quick look at additional enhancements to the framework such as the new c: namespace for constructor arguments, support for Servlet 3.0, improvements to Spring MVC and REST, and Spring's new integration testing support for profiles and configuration classes. In addition, this talk will cover new features under development in the Spring 3.2 road map.
Spring 3.1 to 3.2 in a Nutshell - Spring I/O 2012Sam Brannen
Spring 3.1 introduced several eagerly awaited features including bean definition profiles (a.k.a., environment-specific configuration), enhanced Java-based application and infrastructure configuration (a la XML namespaces), and a new cache abstraction. This session will provide attendees a high-level overview of these major new features plus a quick look at additional enhancements to the framework such as the new c: namespace for constructor arguments, support for Servlet 3.0, improvements to Spring MVC and REST, and Spring's new integration testing support for profiles and configuration classes. In addition, this talk will introduce new features under development in the Spring 3.2 roadmap.
Spring 3.1 in a Nutshell - JAX London 2011Sam Brannen
Spring 3.1 in a Nutshell focused on major new features including the environment and profile abstraction, Java-based configuration with @Enable annotations, improved testing support using @Configuration classes and profiles, a high-level caching API, enhancements to MVC and REST support, explicit Servlet 3.0 integration, and miscellaneous improvements like the "c:" namespace. The presentation provided examples and explanations of how to use these new features in Spring applications.
Spring 3.1 introduces several eagerly awaited features including bean definition profiles (a.k.a., environment-specific beans), enhanced Java-based application and infrastructure configuration (a la XML namespaces), a new cache abstraction, and MVC improvements. This session will provide attendees an in-depth look at these major new features as well as an overview of additional enhancements to the framework such as the new c: namespace for constructor arguments, updates regarding Servlet 3.0, and improvements to Spring's integration testing support.
COVID-19 and the Level of Cloud Computing Adoption: A Study of Sri Lankan Inf...AimanAthambawa1
The study’s main objective is to analyse the level of cloud computing adoption and usage during COVID-19 in Sri
Lanka, especially in Information Technology (IT) organisations. Using senior IT employees, this study investigates
what extent their organisation adopts with cloud computing, the level of cloud computing usage, current use of
cloud service model, usage of cloud deployment model, preferred cloud service providers and reasons for adopting
and not adopting cloud computing. The study also describes why cloud computing is a solution for new normal
situations and the cloud-enabled services used during and after the COVID-19 pandemic. The finding suggests
that 87.7% of the organisations currently use cloud-enabled services, whereas 12.3% do not and intend to adopt.
Considering the benefits, cloud computing is the solution post COVID-19 pandemic to run the business way
forward.
Top 12 AI Technology Trends For 2024.pdfMarrie Morris
Technology has become an irreplaceable component of our daily lives. The role of AI in technology revolutionizes our lives for the betterment of the future. In this article, we will learn about the top 12 AI technology trends for 2024.
Cracking AI Black Box - Strategies for Customer-centric Enterprise ExcellenceQuentin Reul
The democratization of Generative AI is ushering in a new era of innovation for enterprises. Discover how you can harness this powerful technology to deliver unparalleled customer value and securing a formidable competitive advantage in today's competitive market. In this session, you will learn how to:
- Identify high-impact customer needs with precision
- Harness the power of large language models to address specific customer needs effectively
- Implement AI responsibly to build trust and foster strong customer relationships
Whether you're at the early stages of your AI journey or looking to optimize existing initiatives, this session will provide you with actionable insights and strategies needed to leverage AI as a powerful catalyst for customer-driven enterprise success.
Challenges and Strategies of Digital Transformation.pptxwisdomfishlee
In an era where digital innovation is ubiquitous, executives from various corporations frequently seek insights into the tangible benefits that digital transformation can offer. This document outlines a comprehensive framework that elucidates the concept of digital transformation, highlighting its multifaceted dimensions and the pivotal roles it plays in enhancing business competitiveness.
Retrieval Augmented Generation Evaluation with RagasZilliz
Retrieval Augmented Generation (RAG) enhances chatbots by incorporating custom data in the prompt. Using large language models (LLMs) as judge has gained prominence in modern RAG systems. This talk will demo Ragas, an open-source automation tool for RAG evaluations. Christy will talk about and demo evaluating a RAG pipeline using Milvus and RAG metrics like context F1-score and answer correctness.
This PDF delves into the aspects of information security from a forensic perspective, focusing on privacy leaks. It provides insights into the methods and tools used in forensic investigations to uncover and mitigate privacy breaches in mobile and cloud environments.
Finetuning GenAI For Hacking and DefendingPriyanka Aash
Generative AI, particularly through the lens of large language models (LLMs), represents a transformative leap in artificial intelligence. With advancements that have fundamentally altered our approach to AI, understanding and leveraging these technologies is crucial for innovators and practitioners alike. This comprehensive exploration delves into the intricacies of GenAI, from its foundational principles and historical evolution to its practical applications in security and beyond.
Develop Secure Enterprise Solutions with iOS Mobile App Development ServicesDamco Solutions
The security of enterprise apps should not be overlooked by organizations. Since these apps handle confidential finance/user data and business operations, ensuring greater security is crucial. That’s why, businesses should hire dedicated iOS mobile application development services providers for creating super-secured enterprise apps. By incorporating sophisticated security mechanisms, these developers make enterprise apps resistant to a range of cyber threats.
Content source - https://www.bizbangboom.com/articles/enterprise-mobile-app-development-with-ios-augmenting-business-security
Read more - https://www.damcogroup.com/ios-application-development-services
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...Snarky Security
How wonderful it is that in our modern age, every bit of our biological data can be digitized, stored, and potentially pilfered by cyber thieves! Isn't it just splendid to think that while scientists are busy pushing the boundaries of biotechnology, hackers could be plotting the next big bio-data heist? This delightful scenario is brought to you by the ever-expanding digital landscape of biology and biotechnology, where the integration of computer science, engineering, and data science transforms our understanding and manipulation of biological systems.
While the fusion of technology and biology offers immense benefits, it also necessitates a careful consideration of the ethical, security, and associated social implications. But let's be honest, in the grand scheme of things, what's a little risk compared to potential scientific achievements? After all, progress in biotechnology waits for no one, and we're just along for the ride in this thrilling, slightly terrifying, adventure.
So, as we continue to navigate this complex landscape, let's not forget the importance of robust data protection measures and collaborative international efforts to safeguard sensitive biological information. After all, what could possibly go wrong?
-------------------------
This document provides a comprehensive analysis of the security implications biological data use. The analysis explores various aspects of biological data security, including the vulnerabilities associated with data access, the potential for misuse by state and non-state actors, and the implications for national and transnational security. Key aspects considered include the impact of technological advancements on data security, the role of international policies in data governance, and the strategies for mitigating risks associated with unauthorized data access.
This view offers valuable insights for security professionals, policymakers, and industry leaders across various sectors, highlighting the importance of robust data protection measures and collaborative international efforts to safeguard sensitive biological information. The analysis serves as a crucial resource for understanding the complex dynamics at the intersection of biotechnology and security, providing actionable recommendations to enhance biosecurity in an digital and interconnected world.
The evolving landscape of biology and biotechnology, significantly influenced by advancements in computer science, engineering, and data science, is reshaping our understanding and manipulation of biological systems. The integration of these disciplines has led to the development of fields such as computational biology and synthetic biology, which utilize computational power and engineering principles to solve complex biological problems and innovate new biotechnological applications. This interdisciplinary approach has not only accelerated research and development but also introduced new capabilities such as gene editing and biomanufact
Mastering OnlyFans Clone App Development: Key Strategies for SuccessDavid Wilson
Dive into the critical elements of OnlyFans clone app development, from understanding user needs and designing engaging platforms to implementing robust monetization strategies and ensuring scalability. Discover how RichestSoft can guide you through the development process, offering expert insights and proven strategies to help you succeed in the competitive market of content monetization.
The History of Embeddings & Multimodal EmbeddingsZilliz
Frank Liu will walk through the history of embeddings and how we got to the cool embedding models used today. He'll end with a demo on how multimodal RAG is used.
Uncharted Together- Navigating AI's New Frontiers in LibrariesBrian Pichman
Journey into the heart of innovation where the collaborative spirit between information professionals, technologists, and researchers illuminates the path forward through AI's uncharted territories. This opening keynote celebrates the unique potential of special libraries to spearhead AI-driven transformations. Join Brian Pichman as we saddle up to ride into the history of Artificial Intelligence, how its evolved over the years, and how its transforming today's frontiers. We will explore a variety of tools and strategies that leverage AI including some new ideas that may enhance cataloging, unlock personalized user experiences, or pioneer new ways to access specialized research. As with any frontier exploration, we will confront shared ethical challenges and explore how joint efforts can not only navigate but also shape AI's impact on equitable access and information integrity in special libraries. For the remainder of the conference, we will equip you with a "digital compass" where you can submit ideas and thoughts of what you've learned in sessions for a final reveal in the closing keynote.
UX Webinar Series: Aligning Authentication Experiences with Business Goals
Spring 3.1 and MVC Testing Support
1. Spring 3.1 and MVC
Testing Support
Sam Brannen
Swiftmind
Rossen Stoyanchev
SpringSource, VMware
SpringOne 2GX
October 28, 2011
2. Sam Brannen
Senior Software Consultant @ Swiftmind
Java developer with 13+ years' experience
Spring Framework Core Developer
Lead author of Spring in a Nutshell
Previous SpringSource dm Server™ developer
Presenter on Spring, Java, OSGi, and testing
3. Rossen Stoyanchev
Staff Engineer SpringSource, VMware
Spring MVC, Spring Web Flow committer
Teach and consult, Spring Projects
Spring Web course author
NYC area
4. Goals of the
Presentation
Gain an overview of testing features
in Spring 3.1
Learn about the new Spring MVC
Test Support project
6. Show of Hands...
JUnit / TestNG
Spring 2.5 / 3.0 / 3.1
Integration testing with Spring
Spring TestContext Framework
Spring MVC
Spring MVC Test Support
14. Spring & Unit Testing
POJO-based programming model
Program to interfaces
IoC / Dependency Injection
Out-of-container testability
Testing mocks/stubs for various APIs: Servlet,
Portlet, JNDI
General purpose testing utilities
ReflectionTestUtils
ModelAndViewAssert
15. Spring & Integration Testing
ApplicationContext management & caching
Dependency injection of test instances
Transactional test management
with default rollback semantics
SimpleJdbcTestUtils
JUnit 3.8 support classes are deprecated as of
Spring 3.0/3.1
17. Spring JUnit Annotations
Testing Profiles
groups, not bean definition
profiles
@IfProfileValue,
@ProfileValueSourceConfiguration
JUnit extensions
@Timed, @Repeat
18. Using the TestContext
Framework
Use the SpringJUnit4ClassRunner for
JUnit 4.5+
Instrument test class with
TestContextManager for TestNG
Extend one of the base classes
Abstract(Transactional)[JUnit4|TestNG]Spri
19. Example: @POJO Test Class
public class OrderServiceTests {
@Test
public void testOrderService() { … }
}
20. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
public class OrderServiceTests {
@Test
public void testOrderService() { … }
}
21. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
public class OrderServiceTests {
@Test
public void testOrderService() { … }
}
22. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration // defaults to
// OrderServiceTests-context.xml in same package
public class OrderServiceTests {
@Test
public void testOrderService() { … }
}
23. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration // defaults to
// OrderServiceTests-context.xml in same package
public class OrderServiceTests {
@Autowired
private OrderService orderService;
@Test
public void testOrderService() { … }
}
24. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration // defaults to
// OrderServiceTests-context.xml in same package
@Transactional
public class OrderServiceTests {
@Autowired
private OrderService orderService;
@Test
public void testOrderService() { … }
}
25. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration // defaults to
// OrderServiceTests-context.xml in same package
@Transactional
public class OrderServiceTests {
@Autowired
private OrderService orderService;
@BeforeTransaction
public void verifyInitialDatabaseState() { … }
@Test
public void testOrderService() { … }
}
26. Example: @POJO Test Class
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration // defaults to
// OrderServiceTests-context.xml in same package
@Transactional
public class OrderServiceTests {
@Autowired
private OrderService orderService;
@BeforeTransaction
public void verifyInitialDatabaseState() { … }
@Before
public void setUpTestDataWithinTransaction() { … }
@Test
public void testOrderService() { … }
}
30. TestExecutionListener SPI
Reacts to test execution events
Receives reference to current TestContext
Out of the box:
DependencyInjectionTestExecutionListener
DirtiesContextTestExecutionListener
TransactionalTestExecutionListener
34. ContextLoader SPI
Strategy for loading application contexts
from resource locations
Out of the box:
GenericXmlContextLoader
GenericPropertiesContextLoader
69. @Configuration + XML
Q: How can we combine
@Configuration classes with XML
config?
A: Choose one as the entry point.
That's how it works in production
anyway
70. Importing Configuration
In XML:
include @Configuration classes via
component scanning
or define them as normal Spring
beans
In an @Configuration class:
use @ImportResource to import XML
config files
72. @ActiveProfiles
To activate bean definition profiles in tests...
Annotate a test class with
@ActiveProfiles
Supply a list of profiles to be
activated for the test
Can be used with @Configuration
classes and XML config
81. And now an example with
@Configuration classes
82. TransferServiceConfig.java
@Configuration
public class TransferServiceConfig {
@Autowired DataSource dataSource;
@Bean
public TransferService transferService() {
return new DefaultTransferService(accountRepository(),
feePolicy());
}
@Bean
public AccountRepository accountRepository() {
return new JdbcAccountRepository(dataSource);
}
@Bean
public FeePolicy feePolicy() {
return new ZeroFeePolicy();
}
}
83. }
JndiDataConfig.java
@Configuration
@Profile("production")
public class JndiDataConfig {
@Bean
public DataSource dataSource() throws Exception {
Context ctx = new InitialContext();
return (DataSource)
ctx.lookup("java:comp/env/jdbc/datasource");
}
}
95. New Key Generation Algorithm
The context cache key generation algorithm has been updated to include...
locations (from @ContextConfiguration)
classes (from @ContextConfiguration)
contextLoader (from @ContextConfiguration)
activeProfiles (from @ActiveProfiles)
96. Summary
The Spring TestContext Framework simplifies
integration testing of Spring-based
applications
Spring 3.1 provides first-class testing support
for:
@Configuration classes
Environment profiles
See the Testing with @Configuration Classes
and Profiles blog for further insight
99. @Controller
@RequestMapping("/accounts")
public class AccountController {
// ...
@ModelAttribute
public Account getAccount(String number) {
return this.accountManager.getAccount(number);
}
@RequestMapping(method = RequestMethod.POST)
public String save(@Valid Account account,
BindingResult result) {
if (result.hasErrors()) {
return "accounts/edit";
}
this.accountManager.saveOrUpdate(account);
return "redirect:accounts";
}
}
100. Unit Test?
Create controller instance
Mock or stub services & repositories
101. Example
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
}
102. Example
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
AccountManager mgr = createMock(AccountManager.class);
mgr.saveOrUpdate(account);
replay(mgr);
}
103. Example
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
AccountManager mgr = createMock(AccountManager.class);
mgr.saveOrUpdate(account);
replay(mgr);
AccountController contrlr = new AccountController(mgr);
String view = contrlr.save(account, result);
}
104. Example
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
AccountManager mgr = createMock(AccountManager.class);
mgr.saveOrUpdate(account);
replay(mgr);
AccountController contrlr = new AccountController(mgr);
String view = contrlr.save(account, result);
assertEquals("redirect:accounts", view);
verify(mgr);
}
105. Example With Failure
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
result.reject("error.code", "default message")
}
106. Example With Failure
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
result.reject("error.code", "default message")
AccountManager mgr = createMock(AccountManager.class);
replay(mgr);
}
107. Example With Failure
@Test
public void testSave() {
Account account = new Account();
BindingResult result =
new BeanPropertyBindingResult(account, "account");
result.reject("error.code", "default message")
AccountManager mgr = createMock(AccountManager.class);
replay(mgr);
AccountController contrlr = new AccountController(mgr);
String view = contrlr.save(account, result);
assertEquals("accounts/edit", view);
verify(mgr);
}
108. Not Fully Tested
Request mappings
Binding errors
Type conversion
Etc.
113. the only way to verify...
Client-side behavior
Interaction with other server instances
Redis, Rabbit, etc.
114. We'd also like to...
Test controllers once!
Fully & quickly
Execute tests often
115. In summary...
We can't replace the need for end-to-
end tests
But we can minimize errors
Have confidence in @MVC code
During end-to-end tests
116. Spring MVC Test
Built on spring-test
No Servlet container
Drives Spring MVC infrastructure
Both server & client-side test support
(i.e. RestTemplate code)
Inspired by spring-ws-test
117. The Approach
Re-use controller test fixtures
I.e. mocked services & repositories
Invoke @Controller classes through
@MVC infrastructure
119. Under the Covers
Mock request/response from spring-test
DispatcherServlet replacement
Multiple ways to initialize MVC
infrastructure
Save results for expectations
124. About Manual Setup
MVC components instantiated directly
Not looked up in Spring context
Focused, readable tests
But must verify MVC config separately
125. TestContext Framework Example
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(
locations={"/org/example/servlet-context.xml"})
public class TestContextTests {
@Autowired
private WebApplicationContext wac;
@Before
public void setup() {
MockMvc mockMvc =
MockMvcBuilders.webApplicationContextSetup(this.wac)
.build();
}
}
126. TestContext Framework
Caches loaded Spring configuration
Potentially across all tests!
142. Resources for Spring MVC Test
Project Home:
https://github.com/SpringSource/spring-test-mvc
Sample Tests:
org.springframework.test.web.server.samples
143. Resources for Core Spring
Spring Framework:
http://www.springsource.org/spring-core
Reference Manual: Spring 3.1 RC1
Forums: http://forum.springframework.org
JIRA: https://jira.springsource.org
Spring in a Nutshell … available in 2012