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 com.ahmet.springboot.helloworld.controller; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RestController | |
public class HelloWorldController { | |
@RequestMapping("/") | |
public String printHelloWorld() { | |
return "I just want to say hello -- Spring Boot!"; |
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 mytest; | |
public class Loan { | |
private double annualInterestRate; | |
private int numberOfYears; | |
private double loanAmount; | |
private java.util.Date loanDate; | |
/** Default constructor */ | |
public Loan() { |
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 mytest; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
public class LoanTest { | |
@Before | |
public void setUp() throws Exception { | |
} | |
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 mytest; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
import java.util.*; | |
public class ArrayListTest { | |
private ArrayList<String> list = new ArrayList<String>(); | |
@Before | |
public void setUp() throws Exception { |
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 mytest; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
public class ATest { | |
@Test | |
public void m1() { | |
// Write a test method | |
} |
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
var BurgerMenuOrder = artifacts.require('BurgerMenuOrder'); | |
contract('BurgerMenuOrder', function(accounts) { | |
var seller = null; | |
var customer = null; | |
var orderno = null; | |
var invoiceno = null; | |
var price = null; |
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
// function to send order | |
function sendOrder(string memory burgerMenu, uint quantity) payable public { | |
// only the customer can use this function | |
require(msg.sender == customerAddress); | |
// increase the order index | |
orderseq++; | |
// create the order | |
orders[orderseq] = Order(orderseq, burgerMenu, quantity, 0, 0, 0, 0, true); |
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
// event triggers when order sent | |
event OrderSent(address customer, string burgerMenu, uint quantity, uint orderNo); | |
// event triggers when price sent | |
event PriceSent(address customer, uint orderNo, uint price); | |
// event triggers when safe payment sent | |
event SafePaymentSent(address customer, uint orderNo, uint value, uint now); | |
// event triggers when invoice sent |
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
// BurgerMenuOrder constructor | |
constructor(address _buyerAddr) public payable { | |
owner = msg.sender; | |
customerAddress = _buyerAddr; | |
} |
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
// mapping for orders to have an list for the orders | |
mapping (uint => Order) orders; | |
// mapping for invoices to have an list for the invoices | |
mapping (uint => Invoice) invoices; | |
// index value of the orders | |
uint orderseq; | |
// index value of the invoices |
NewerOlder