{"action":"created","comment":{"url":"https://api.github.com/repos/influunt/influunt/pulls/comments/67399936","id":67399936,"diff_hunk":"@@ -0,0 +1,145 @@\n+import com.fasterxml.jackson.databind.JsonNode;\n+import controllers.routes;\n+import models.ConfiguracaoControlador;\n+import models.Fabricante;\n+import org.junit.Test;\n+import play.Application;\n+import play.Mode;\n+import play.inject.guice.GuiceApplicationBuilder;\n+import play.libs.Json;\n+import play.mvc.Http;\n+import play.mvc.Result;\n+import play.test.Helpers;\n+import play.test.WithApplication;\n+import security.Authenticator;\n+\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.UUID;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertNotNull;\n+import static org.junit.Assert.assertNull;\n+import static play.inject.Bindings.bind;\n+import static play.test.Helpers.inMemoryDatabase;\n+import static play.test.Helpers.route;\n+\n+\n+public class ConfiguracoesControladoresControllerTest extends WithApplication {\n+\n+    @Override\n+    protected Application provideApplication() {\n+        Map<String, String> options = new HashMap<String, String>();\n+        options.put(\"DATABASE_TO_UPPER\", \"FALSE\");\n+        return getApplication(inMemoryDatabase(\"default\", options));\n+    }\n+\n+    @SuppressWarnings({\"unchecked\", \"rawtypes\"})\n+    private Application getApplication(Map configuration) {\n+        return new GuiceApplicationBuilder().configure(configuration)\n+                .overrides(bind(Authenticator.class).to(TestAuthenticator.class)).in(Mode.TEST).build();\n+    }\n+\n+    @Test\n+    @SuppressWarnings(\"unchecked\")\n+    public void testListarConfiguracoesControladores() {\n+        ConfiguracaoControlador configuracaoControlador = new ConfiguracaoControlador();\n+        configuracaoControlador.save();\n+\n+        ConfiguracaoControlador configuracaoControlador1 = new ConfiguracaoControlador();\n+        configuracaoControlador1.save();\n+\n+        Http.RequestBuilder request = new Http.RequestBuilder().method(\"GET\")\n+                .uri(routes.ConfiguracoesControladoresController.findAll().url());\n+        Result result = route(request);\n+        JsonNode json = Json.parse(Helpers.contentAsString(result));\n+        List<ConfiguracaoControlador> configuracoesControladores = Json.fromJson(json, List.class);\n+\n+        assertEquals(200, result.status());\n+        assertEquals(2, configuracoesControladores.size());\n+    }\n+\n+    @Test\n+    public void testCriarNovaConfiguracaoControlador() {\n+        ConfiguracaoControlador configuracaoControlador = new ConfiguracaoControlador();\n+        Http.RequestBuilder request = new Http.RequestBuilder().method(\"POST\")\n+                .uri(routes.ConfiguracoesControladoresController.create().url()).bodyJson(Json.toJson(configuracaoControlador));\n+        Result result = route(request);\n+        JsonNode json = Json.parse(Helpers.contentAsString(result));\n+        ConfiguracaoControlador configuracaoControladorRetornada = Json.fromJson(json, ConfiguracaoControlador.class);\n+\n+        assertEquals(200, result.status());\n+        assertNotNull(configuracaoControladorRetornada.getId());\n+    }\n+\n+    @Test\n+    public void testAtualizarConfiguracaoControladorExistente() {\n+        ConfiguracaoControlador configuracaoControlador = new ConfiguracaoControlador();\n+        configuracaoControlador.save();\n+\n+        UUID configuracaoControladorId = configuracaoControlador.getId();\n+        assertNotNull(configuracaoControladorId);\n+\n+        ConfiguracaoControlador configuracaoControlador1 = new ConfiguracaoControlador();\n+\n+        Http.RequestBuilder request = new Http.RequestBuilder().method(\"PUT\")\n+                .uri(routes.ConfiguracoesControladoresController.update(configuracaoControladorId.toString()).url())\n+                .bodyJson(Json.toJson(configuracaoControlador1));\n+        Result result = route(request);\n+        JsonNode json = Json.parse(Helpers.contentAsString(result));\n+        ConfiguracaoControlador fabricanteRetornado = Json.fromJson(json, ConfiguracaoControlador.class);\n+\n+        assertEquals(200, result.status());\n+        assertNotNull(fabricanteRetornado.getId());\n+    }\n+\n+    @Test\n+    public void testAtualizarConfiguracaoControladorNaoExistente() {\n+        ConfiguracaoControlador fabricante = new ConfiguracaoControlador();","path":"influunt-api/test/ConfiguracoesControladoresControllerTest.java","position":99,"original_position":99,"commit_id":"11e363089d1b88c3ab7a37323f997a82d0860ae0","original_commit_id":"11e363089d1b88c3ab7a37323f997a82d0860ae0","user":{"login":"lesio","id":389829,"avatar_url":"https://avatars.githubusercontent.com/u/389829?v=3","gravatar_id":"","url":"https://api.github.com/users/lesio","html_url":"https://github.com/lesio","followers_url":"https://api.github.com/users/lesio/followers","following_url":"https://api.github.com/users/lesio/following{/other_user}","gists_url":"https://api.github.com/users/lesio/gists{/gist_id}","starred_url":"https://api.github.com/users/lesio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesio/subscriptions","organizations_url":"https://api.github.com/users/lesio/orgs","repos_url":"https://api.github.com/users/lesio/repos","events_url":"https://api.github.com/users/lesio/events{/privacy}","received_events_url":"https://api.github.com/users/lesio/received_events","type":"User","site_admin":false},"body":"trocar o nome da variavel **fabricante**","created_at":"2016-06-16T18:33:52Z","updated_at":"2016-06-16T18:33:52Z","html_url":"https://github.com/influunt/influunt/pull/77#discussion_r67399936","pull_request_url":"https://api.github.com/repos/influunt/influunt/pulls/77","_links":{"self":{"href":"https://api.github.com/repos/influunt/influunt/pulls/comments/67399936"},"html":{"href":"https://github.com/influunt/influunt/pull/77#discussion_r67399936"},"pull_request":{"href":"https://api.github.com/repos/influunt/influunt/pulls/77"}}},"pull_request":{"url":"https://api.github.com/repos/influunt/influunt/pulls/77","id":74117062,"html_url":"https://github.com/influunt/influunt/pull/77","diff_url":"https://github.com/influunt/influunt/pull/77.diff","patch_url":"https://github.com/influunt/influunt/pull/77.patch","issue_url":"https://api.github.com/repos/influunt/influunt/issues/77","number":77,"state":"open","locked":false,"title":"CRUD configuração controlador","user":{"login":"ppires","id":194442,"avatar_url":"https://avatars.githubusercontent.com/u/194442?v=3","gravatar_id":"","url":"https://api.github.com/users/ppires","html_url":"https://github.com/ppires","followers_url":"https://api.github.com/users/ppires/followers","following_url":"https://api.github.com/users/ppires/following{/other_user}","gists_url":"https://api.github.com/users/ppires/gists{/gist_id}","starred_url":"https://api.github.com/users/ppires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppires/subscriptions","organizations_url":"https://api.github.com/users/ppires/orgs","repos_url":"https://api.github.com/users/ppires/repos","events_url":"https://api.github.com/users/ppires/events{/privacy}","received_events_url":"https://api.github.com/users/ppires/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-16T17:04:55Z","updated_at":"2016-06-16T18:33:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"710dbf254adb2c75154b289b13c96fd909b995cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/influunt/influunt/pulls/77/commits","review_comments_url":"https://api.github.com/repos/influunt/influunt/pulls/77/comments","review_comment_url":"https://api.github.com/repos/influunt/influunt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influunt/influunt/issues/77/comments","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/11e363089d1b88c3ab7a37323f997a82d0860ae0","head":{"label":"influunt:75-crud-config-controlador","ref":"75-crud-config-controlador","sha":"11e363089d1b88c3ab7a37323f997a82d0860ae0","user":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"repo":{"id":60134030,"name":"influunt","full_name":"influunt/influunt","owner":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influunt/influunt","description":"","fork":false,"url":"https://api.github.com/repos/influunt/influunt","forks_url":"https://api.github.com/repos/influunt/influunt/forks","keys_url":"https://api.github.com/repos/influunt/influunt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influunt/influunt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influunt/influunt/teams","hooks_url":"https://api.github.com/repos/influunt/influunt/hooks","issue_events_url":"https://api.github.com/repos/influunt/influunt/issues/events{/number}","events_url":"https://api.github.com/repos/influunt/influunt/events","assignees_url":"https://api.github.com/repos/influunt/influunt/assignees{/user}","branches_url":"https://api.github.com/repos/influunt/influunt/branches{/branch}","tags_url":"https://api.github.com/repos/influunt/influunt/tags","blobs_url":"https://api.github.com/repos/influunt/influunt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influunt/influunt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influunt/influunt/git/refs{/sha}","trees_url":"https://api.github.com/repos/influunt/influunt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/{sha}","languages_url":"https://api.github.com/repos/influunt/influunt/languages","stargazers_url":"https://api.github.com/repos/influunt/influunt/stargazers","contributors_url":"https://api.github.com/repos/influunt/influunt/contributors","subscribers_url":"https://api.github.com/repos/influunt/influunt/subscribers","subscription_url":"https://api.github.com/repos/influunt/influunt/subscription","commits_url":"https://api.github.com/repos/influunt/influunt/commits{/sha}","git_commits_url":"https://api.github.com/repos/influunt/influunt/git/commits{/sha}","comments_url":"https://api.github.com/repos/influunt/influunt/comments{/number}","issue_comment_url":"https://api.github.com/repos/influunt/influunt/issues/comments{/number}","contents_url":"https://api.github.com/repos/influunt/influunt/contents/{+path}","compare_url":"https://api.github.com/repos/influunt/influunt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influunt/influunt/merges","archive_url":"https://api.github.com/repos/influunt/influunt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influunt/influunt/downloads","issues_url":"https://api.github.com/repos/influunt/influunt/issues{/number}","pulls_url":"https://api.github.com/repos/influunt/influunt/pulls{/number}","milestones_url":"https://api.github.com/repos/influunt/influunt/milestones{/number}","notifications_url":"https://api.github.com/repos/influunt/influunt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influunt/influunt/labels{/name}","releases_url":"https://api.github.com/repos/influunt/influunt/releases{/id}","deployments_url":"https://api.github.com/repos/influunt/influunt/deployments","created_at":"2016-06-01T00:55:14Z","updated_at":"2016-06-14T17:55:46Z","pushed_at":"2016-06-16T18:33:23Z","git_url":"git://github.com/influunt/influunt.git","ssh_url":"git@github.com:influunt/influunt.git","clone_url":"https://github.com/influunt/influunt.git","svn_url":"https://github.com/influunt/influunt","homepage":null,"size":4478,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":0,"default_branch":"staging"}},"base":{"label":"influunt:staging","ref":"staging","sha":"82a4c15ae99416f4c4f1dae7f2ec86d1d0ebe189","user":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"repo":{"id":60134030,"name":"influunt","full_name":"influunt/influunt","owner":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influunt/influunt","description":"","fork":false,"url":"https://api.github.com/repos/influunt/influunt","forks_url":"https://api.github.com/repos/influunt/influunt/forks","keys_url":"https://api.github.com/repos/influunt/influunt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influunt/influunt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influunt/influunt/teams","hooks_url":"https://api.github.com/repos/influunt/influunt/hooks","issue_events_url":"https://api.github.com/repos/influunt/influunt/issues/events{/number}","events_url":"https://api.github.com/repos/influunt/influunt/events","assignees_url":"https://api.github.com/repos/influunt/influunt/assignees{/user}","branches_url":"https://api.github.com/repos/influunt/influunt/branches{/branch}","tags_url":"https://api.github.com/repos/influunt/influunt/tags","blobs_url":"https://api.github.com/repos/influunt/influunt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influunt/influunt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influunt/influunt/git/refs{/sha}","trees_url":"https://api.github.com/repos/influunt/influunt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/{sha}","languages_url":"https://api.github.com/repos/influunt/influunt/languages","stargazers_url":"https://api.github.com/repos/influunt/influunt/stargazers","contributors_url":"https://api.github.com/repos/influunt/influunt/contributors","subscribers_url":"https://api.github.com/repos/influunt/influunt/subscribers","subscription_url":"https://api.github.com/repos/influunt/influunt/subscription","commits_url":"https://api.github.com/repos/influunt/influunt/commits{/sha}","git_commits_url":"https://api.github.com/repos/influunt/influunt/git/commits{/sha}","comments_url":"https://api.github.com/repos/influunt/influunt/comments{/number}","issue_comment_url":"https://api.github.com/repos/influunt/influunt/issues/comments{/number}","contents_url":"https://api.github.com/repos/influunt/influunt/contents/{+path}","compare_url":"https://api.github.com/repos/influunt/influunt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influunt/influunt/merges","archive_url":"https://api.github.com/repos/influunt/influunt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influunt/influunt/downloads","issues_url":"https://api.github.com/repos/influunt/influunt/issues{/number}","pulls_url":"https://api.github.com/repos/influunt/influunt/pulls{/number}","milestones_url":"https://api.github.com/repos/influunt/influunt/milestones{/number}","notifications_url":"https://api.github.com/repos/influunt/influunt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influunt/influunt/labels{/name}","releases_url":"https://api.github.com/repos/influunt/influunt/releases{/id}","deployments_url":"https://api.github.com/repos/influunt/influunt/deployments","created_at":"2016-06-01T00:55:14Z","updated_at":"2016-06-14T17:55:46Z","pushed_at":"2016-06-16T18:33:23Z","git_url":"git://github.com/influunt/influunt.git","ssh_url":"git@github.com:influunt/influunt.git","clone_url":"https://github.com/influunt/influunt.git","svn_url":"https://github.com/influunt/influunt","homepage":null,"size":4478,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":29,"forks":0,"open_issues":29,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/influunt/influunt/pulls/77"},"html":{"href":"https://github.com/influunt/influunt/pull/77"},"issue":{"href":"https://api.github.com/repos/influunt/influunt/issues/77"},"comments":{"href":"https://api.github.com/repos/influunt/influunt/issues/77/comments"},"review_comments":{"href":"https://api.github.com/repos/influunt/influunt/pulls/77/comments"},"review_comment":{"href":"https://api.github.com/repos/influunt/influunt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influunt/influunt/pulls/77/commits"},"statuses":{"href":"https://api.github.com/repos/influunt/influunt/statuses/11e363089d1b88c3ab7a37323f997a82d0860ae0"}}}}
{"actor":{"display_login":"lesio"}}