From cf70bc7bcb24cc231cf837040b117aab409d8f38 Mon Sep 17 00:00:00 2001 From: snoop Date: Thu, 21 Sep 2017 19:24:24 +0900 Subject: [PATCH] added apikey readByApikey --- .../overflow/module/apikey/service/ApiKeyService.java | 4 ++++ .../module/apikey/service/ApiKeyServiceTest.java | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/com/loafle/overflow/module/apikey/service/ApiKeyService.java b/src/main/java/com/loafle/overflow/module/apikey/service/ApiKeyService.java index b9e8919..345ba34 100644 --- a/src/main/java/com/loafle/overflow/module/apikey/service/ApiKeyService.java +++ b/src/main/java/com/loafle/overflow/module/apikey/service/ApiKeyService.java @@ -37,4 +37,8 @@ public class ApiKeyService { return true; } + public ApiKey readByApiKey(String apiKey) { + return this.apiKeyDAO.findByApiKey(apiKey); + } + } diff --git a/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java b/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java index 49b182d..993e33e 100644 --- a/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java +++ b/src/test/java/com/loafle/overflow/module/apikey/service/ApiKeyServiceTest.java @@ -1,5 +1,6 @@ package com.loafle.overflow.module.apikey.service; +import com.google.protobuf.Api; import com.loafle.overflow.module.apikey.model.ApiKey; import com.loafle.overflow.module.domain.model.Domain; import com.loafle.overflow.spring.AppConfigTest; @@ -68,4 +69,13 @@ public class ApiKeyServiceTest { } + @Test + public void readByApiKey() { + + ApiKey apiKey = this.apiKeyService.readByApiKey("52abd6fd57e511e7ac52080027658d13"); + + Assert.assertNotEquals(apiKey, null); + + } + } \ No newline at end of file