Last active
May 17, 2022 09:36
-
-
Save mesutpiskin/47bc3f9bbaebc96e33328e3b94d6745e to your computer and use it in GitHub Desktop.
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
class ProductPurchasingStepDefinitions { | |
@Given("{string} kodlu kullanıcı oturum açmalıdır") | |
public void kullaniciOturumAcmalidir(String p1) { | |
User user = new User(); | |
user.code = p1; | |
user.password = "****"; | |
RestUtils.Post("http://localhost:8080/userservice/user/login", user); | |
} | |
@Given("{string} kodlu ürünün stok miktarı {long} olarak güncellenir") | |
public void urununStokMiktariGuncellenir(String p1, Long p2) { | |
Product product = RestUtils.Get("http://localhost:8080/productservice/"+p1); | |
product.stock = p2; | |
RestUtils.Put("http://localhost:8080/productservice/"+p1, product); | |
} | |
@Given("{string} kodlu kullanıcının sepeti temizlenir") | |
public void kullanicininSepetiTemizlenir(String p1) { | |
... | |
} | |
@Given("{string} kodlu üründen sepete {long} adet eklenir") | |
public void sepeteUrunEklenir(String p1, Long p2) { | |
... | |
} | |
@When("{string}kodlu kullanıcı ödeme işlemi gerçekleştirildiğinde") | |
public void kullaniciOdemeIslemiGerceklestirildiginde(String p1) { | |
... | |
} | |
@Then("Başarılı sonucu alınmalıdır") | |
public void basariliSonucuAlinmalidir() { | |
... | |
} | |
@Then("{string} kodlu kullanıcı için {string} ürününü içeren sipariş oluşmalıdır") | |
public void siparisOlusmalidir(String p1, String p2) { | |
List<Order> orders = RestUtils.Get("http://localhost:8080/orderservice/order"); | |
assertThat(orders.getMyItems(), | |
hasItem(hasProperty("code", is(p2)))); | |
} | |
@Then("{string} kodlu ürün stoğu {long} olmalıdır") | |
public void urunStoguKontrolEdilir(String p1, Long p2) { | |
Product product = RestUtils.Get("http://localhost:8080/productservice/product/"+p1); | |
assertEquals(product.stock, p2); | |
} | |
@Given("{string} kodlu ürünün stok miktarı {long} olarak güncellenir") | |
public void stokGuncellenir(String p1, Long p2) { | |
... | |
} | |
@Then("Başarısız sonucu alınmalıdır") | |
public void basarisizSonucuAlinmalidir() { | |
... | |
} | |
@Then("{string} kodlu kullanıcı için sipariş oluşturulmamalıdır") | |
public void siparisOlusturulmamalidir(String p1) { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment