-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
103 lines (66 loc) · 2.77 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# ✨ Mock Twitter Example: Standalone Grails Application for Learning 🌟
This repository contains a **standalone Grails application** designed as an educational tool. It uses a "Twitter" theme as an example to help students learn the basics of:
- 🏗️ Building a Grails application.
- 🧪 Writing unit and functional tests.
- 🤖 Simulating external services with mock data.
- 🌐 Creating fake endpoints for testing purposes.
This example is **not connected to Twitter** or any external libraries like Twitter4J. It is purely a demonstration project for learning purposes.
---
## 🚀 Features
- **Self-Contained Example**: No external dependencies or API keys are needed.
- **Mock Services and Endpoints**: Examples of stubbing and faking external interactions.
- **Testing Examples**: Includes pre-configured unit and functional tests using **Geb** and **Spock**.
- **Educational Focus**: Designed to demonstrate Grails application structure and testing methodologies.
---
## 🛠️ Getting Started
### 📋 Prerequisites
- **Grails Framework**: [Installation Guide](https://grails.org/download.html)
- **Java Development Kit (JDK)**: Ensure compatibility with your Grails version.
### ⚙️ Setup Instructions
1. **Clone this repository**:
```bash
git clone https://github.com/your-repository/mock-twitter-grails-example.git
cd mock-twitter-grails-example
```
2. **Install dependencies**:
```bash
grails dependencies
```
3. **Run the application**:
```bash
grails run-app
```
> **Note**: No external API keys are required. This project is entirely self-contained.
---
## 🧪 Running Tests
### ✅ Unit Tests
Run the unit tests to validate individual components:
```bash
grails test-app -unit
```
### 🌟 Functional Tests
Run the functional tests to verify end-to-end workflows:
```bash
grails test-app -functional
```
---
## 🛠️ Code Highlights
- 🤖 **Mock Services**: Demonstrates service stubbing for simulating external API calls (`src/test/groovy`).
- 🌐 **Fake Endpoints**: Provides example controllers for simulating API behavior (`grails-app/controllers`).
- 🌟 **Functional Tests with Geb**: Pre-configured functional tests located in `src/integration-test/groovy`.
---
## 📚 Notes for Students
- This project is intended for **learning purposes only**.
- The "Twitter" theme is used purely as a conceptual example.
- Feel free to adapt the project to explore other themes or use cases.
---
## 🤝 Contributing
Contributions are welcome! To contribute:
1. Fork the repository.
2. Create a new branch for your feature or bug fix.
3. Submit a pull request for review.
---
## 📜 License
This project is licensed under the [MIT License](LICENSE).
---
For any questions or support, feel free to reach out via the Issues tab. 💬