This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.singh1114.springboottut; | |
import io.singh1114.springboottut.school.School; | |
import io.singh1114.springboottut.school.SchoolRepository; | |
import org.json.JSONException; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.skyscreamer.jsonassert.JSONAssert; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.boot.test.context.SpringBootTest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<div class="entry"> | |
{% include share-bar.html %} | |
{% assign content_para = content | split: "<p>" %} | |
{% for para in content_para %} | |
{{para}} | |
{% assign para_number = forloop.index | modulo: 10 %} | |
{% if para_number == 0 %} | |
<h2>Your SPECIAL CODE</h2> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
<article class="post"> | |
<h1>{{ page.title }}</h1> | |
<div class="date"> | |
Written on {{ page.date | date: "%B %e, %Y" }} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.singh1114.springboottut.school; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.*; | |
import java.util.ArrayList; | |
import java.util.List; | |
@RestController | |
public class SchoolController { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.singh1114.springboottut.school; | |
import javax.persistence.*; | |
@Entity | |
public class School { | |
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name="id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.singh1114.springboottut.standard; | |
public class Standard { | |
private String standard; | |
private String section; | |
private String classTeacher; | |
public Standard(String standard, String section, String classTeacher) { | |
super(); | |
this.standard = standard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.singh1114.springboottut.status; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class StatusController { | |
@RequestMapping("status") | |
public String tellStatus() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.singh1114.springboottut; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
public class RestAPI { | |
public static void main(String[] args) { | |
SpringApplication.run(RestAPI.class, args); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.singh1114.springboottut</groupId> | |
<artifactId>rest-api</artifactId> | |
<version>1.0-SNAPSHOT</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sinon = require('sinon'); | |
const should = require('should'); | |
describe('validate Params middleware', () => { | |
it('When param is required', () => { | |
let nextSpy = sinon.spy(); | |
let response = function () {}; | |
response.send = sinon.spy(); | |
validateParams([{ |