id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
186361323_5
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullToDefault() {\n Assert.assertNull(StrKit.nullToDefault(null, null));\n\n Assert.assertEquals(\"3\", StrKit.nullToDefault(\"3\", \"1a 2b 3c\"));\n }", "class_method_signature": "StrKitTest.testNullToDefault()", "constructor": false, "full_signature": "@T...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static String nullToDefault(String str, String defaultStr) {\n return (str == null) ? defaultStr : str;\n }", "class_method_signature": "StrKit.nullToDefault(String str, String defaultStr)", "constructor": false, "full_signature": "public static String nullToDefault(String str, Strin...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_4
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testNullToEmpty() {\n Assert.assertEquals(\"1a 2b 3c\", StrKit.nullToEmpty(\"1a 2b 3c\"));\n }", "class_method_signature": "StrKitTest.testNullToEmpty()", "constructor": false, "full_signature": "@Test public void testNullToEmpty()", "identifier": "testNullToEmpty",...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static String nullToEmpty(String str) {\n return nullToDefault(str, EMPTY);\n }", "class_method_signature": "StrKit.nullToEmpty(String str)", "constructor": false, "full_signature": "public static String nullToEmpty(String str)", "identifier": "nullToEmpty", "invocations": [ ...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_3
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsNotEmpty() {\n Assert.assertTrue(StrKit.isNotEmpty(\",\"));\n\n Assert.assertFalse(StrKit.isNotEmpty(null));\n }", "class_method_signature": "StrKitTest.testIsNotEmpty()", "constructor": false, "full_signature": "@Test public void testIsNotEmpty()", "id...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static boolean isNotEmpty(String str) {\n return false == isEmpty(str);\n }", "class_method_signature": "StrKit.isNotEmpty(String str)", "constructor": false, "full_signature": "public static boolean isNotEmpty(String str)", "identifier": "isNotEmpty", "invocations": [ "isEmp...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_2
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testIsEmpty() {\n Assert.assertTrue(StrKit.isEmpty(null));\n Assert.assertTrue(StrKit.isEmpty(\"\"));\n\n Assert.assertFalse(StrKit.isEmpty(\"1a 2b 3c\"));\n }", "class_method_signature": "StrKitTest.testIsEmpty()", "constructor": false, "full_signature"...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static boolean isEmpty(String str) {\n return str == null || str.length() == 0;\n }", "class_method_signature": "StrKit.isEmpty(String str)", "constructor": false, "full_signature": "public static boolean isEmpty(String str)", "identifier": "isEmpty", "invocations": [ "length...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_1
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFirstCharToUpperCase() {\n Assert.assertEquals(\"BAZ\", StrKit.firstCharToUpperCase(\"BAZ\"));\n Assert.assertEquals(\"Foo\", StrKit.firstCharToUpperCase(\"foo\"));\n }", "class_method_signature": "StrKitTest.testFirstCharToUpperCase()", "constructor": false,...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static String firstCharToUpperCase(String str) {\n char firstChar = str.charAt(0);\n if (firstChar >= 'a' && firstChar <= 'z') {\n char[] arr = str.toCharArray();\n arr[0] -= ('a' - 'A');\n return new String(arr);\n }\n return str;\n }"...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_0
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFirstCharToLowerCase() {\n Assert.assertEquals(\"foo\", StrKit.firstCharToLowerCase(\"foo\"));\n Assert.assertEquals(\"1234\", StrKit.firstCharToLowerCase(\"1234\"));\n Assert.assertEquals(\"bar\", StrKit.firstCharToLowerCase(\"Bar\"));\n }", "class_meth...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static String firstCharToLowerCase(String str) {\n char firstChar = str.charAt(0);\n if (firstChar >= 'A' && firstChar <= 'Z') {\n char[] arr = str.toCharArray();\n arr[0] += ('a' - 'A');\n return new String(arr);\n }\n return str;\n }"...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_7
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToCamelCase() {\n Assert.assertNull(StrKit.toCamelCase(null));\n\n Assert.assertEquals(\"a\\'b\\'c\", StrKit.toCamelCase(\"a\\'b\\'c\"));\n Assert.assertEquals(\"fooBar\", StrKit.toCamelCase(\"foo_bar\"));\n }", "class_method_signature": "StrKitTest.test...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static String toCamelCase(String name) {\n if (name == null) {\n return null;\n }\n if (name.contains(UNDERLINE)) {\n name = name.toLowerCase();\n\n StringBuilder sb = new StringBuilder(name.length());\n boolean upperCase = false;\n ...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
186361323_6
{ "fields": [], "file": "flash-generator/src/test/java/cn/enilu/flash/code/StrKitTest.java", "identifier": "StrKitTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testToUnderlineCase() {\n Assert.assertNull(StrKit.toUnderlineCase(null));\n\n Assert.assertEquals(\"1\", StrKit.toUnderlineCase(\"1\"));\n Assert.assertEquals(\"foo\", StrKit.toUnderlineCase(\"foo\"));\n Assert.assertEquals(\"bar\", StrKit.toUnderlineCase...
{ "fields": [ { "declarator": "SPACE = \" \"", "modifier": "public static final", "original_string": "public static final String SPACE = \" \";", "type": "String", "var_name": "SPACE" }, { "declarator": "DOT = \".\"", "modifier": "public static final", "orig...
{ "body": "public static String toUnderlineCase(String camelCaseStr) {\n if (camelCaseStr == null) {\n return null;\n }\n\n final int length = camelCaseStr.length();\n StringBuilder sb = new StringBuilder();\n char c;\n boolean isPreUpperCase = false;\n for ...
{ "created": "5/13/2019 6:47:20 AM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 186361323, "size": null, "stargazer_count": null, "stars": 641, "updates": "2020-01-26T03:59:03+00:00", "url": "https://github.com/enilu/web-flash...
111640979_1
{ "fields": [ { "declarator": "sendMail", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private SendMail sendMail;", "type": "SendMail", "var_name": "sendMail" } ], "file": "springboot-rabbitmq/src/test/java/com/ocly/util/sendMailTest.java", "id...
{ "body": "@Test\n public void hellomaiTemplate() throws Exception {\n sendMail.sendtemplateHtmlMail(\"你好,模板邮件加附件加图片\",\"1193889747@qq.com\",\"Bocly\");\n }", "class_method_signature": "sendMailTest.hellomaiTemplate()", "constructor": false, "full_signature": "@Test public void hellomaiTemplate()",...
{ "fields": [ { "declarator": "javaMailSender", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private JavaMailSender javaMailSender;", "type": "JavaMailSender", "var_name": "javaMailSender" }, { "declarator": "templateEngine", "modifie...
{ "body": "public void sendtemplateHtmlMail(String subject, String to, String name) {\n\n MimeMessage mimeMessage = javaMailSender.createMimeMessage();\n\n try {\n // 创建多部件的mail\n MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);\n helper.setSubject(su...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111640979, "size": 457, "stargazer_count": 100, "stars": null, "updates": null, "url": "https://github.com/yy1193889747/springboot-demo" }
111640979_0
{ "fields": [ { "declarator": "sendMail", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private SendMail sendMail;", "type": "SendMail", "var_name": "sendMail" } ], "file": "springboot-rabbitmq/src/test/java/com/ocly/util/sendMailTest.java", "id...
{ "body": "@Test\n public void hello() throws Exception {\n sendMail.sendSimpleMail(\"aaaa\",\"1193889747@qq.com\",\"sdas\");\n }", "class_method_signature": "sendMailTest.hello()", "constructor": false, "full_signature": "@Test public void hello()", "identifier": "hello", "invocations": [ ...
{ "fields": [ { "declarator": "javaMailSender", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private JavaMailSender javaMailSender;", "type": "JavaMailSender", "var_name": "javaMailSender" }, { "declarator": "templateEngine", "modifie...
{ "body": "public void sendSimpleMail(String subject, String to, String context) {\n SimpleMailMessage simpleMailMessage = new SimpleMailMessage();\n\n simpleMailMessage.setFrom(from);\n simpleMailMessage.setTo(to);\n simpleMailMessage.setSubject(subject);\n simpleMailMessage.setTex...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 111640979, "size": 457, "stargazer_count": 100, "stars": null, "updates": null, "url": "https://github.com/yy1193889747/springboot-demo" }
200539506_13
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private EmailMessageOperations operations;", "type": "EmailMessageOperations", "var_name": "operations" }, { "declarator": "repo", "modifier": "@Mock\n private", "origi...
{ "body": "@Test\n public void getMessageByStatus() throws Exception {\n // given\n String status = \"COMPLETED\";\n Status requestStatus = Status.fromValue(status);\n EmailMessage emailMessage = new EmailMessage(Status.fromValue(\"COMPLETED\"), \"EMAIL MESSAGE RESPONSE\");\n\n /...
{ "fields": [ { "declarator": "emailMessageRepo", "modifier": "private final", "original_string": "private final EmailMessageRepo emailMessageRepo;", "type": "EmailMessageRepo", "var_name": "emailMessageRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/EmailMes...
{ "body": "public EmailMessageResponse getMessageByStatus(String status){\n Status requestStatus = Status.fromValue(status);\n\n if(requestStatus == null || !requestStatus.isValid()){\n ErrorType.REQUEST_STATUS_IS_NOT_VALID.throwException();\n }\n\n EmailMessage emailMessage = e...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_44
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private ColorTypeOperations operations;", "type": "ColorTypeOperations", "var_name": "operations" }, { "declarator": "colorTypeRepo", "modifier": "@Mock", "original_string...
{ "body": "@Test\n public void getAllAvailableColors() throws Exception {\n // given\n ColorType color = new ColorType(1, \"yellow\");\n\n List<ColorType> colorList = Arrays.asList(color);\n\n when(colorTypeRepo.findByAvailable(true)).thenReturn(colorList);\n \n // when\n ...
{ "fields": [ { "declarator": "colorTypeRepo", "modifier": "private final", "original_string": "private final ColorTypeRepo colorTypeRepo;", "type": "ColorTypeRepo", "var_name": "colorTypeRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/ColorTypeOperations.jav...
{ "body": "public DataResponse<ColorType> getActiveColors() {\n DataResponse<ColorType> response = new DataResponse<ColorType>(\"Could not get color list\");\n\n List<ColorType> colors = colorTypeRepo.findByAvailable(true);\n\n if (colors == null || colors.isEmpty()){\n ErrorType.COLOR...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_52
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userDeleteFail() {\n Employee e = new Employee();\n e.setId(1);\n\n when(employeeRepo.findEmployeeById(e.getId())).thenReturn(e);\n doThrow(new RuntimeException()).when(employeeRepo).deleteById(1);\n\n GenericResponse response = operations.deleteUse...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse deleteUser(Integer id) {\n GenericResponse response = new GenericResponse();\n Employee e = employeeRepo.findEmployeeById(id);\n\n if(e != null) {\n try {\n employeeRepo.deleteById(id);\n response.setSuccess(true);\n ...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_29
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void createNewPrintJobSaveAllNonExistentData() {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>();\n\n byte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFile(\"something.stl\", \"so...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> newPrintJob(PrintJobNewRequest printJobNewRequest, Principal principal) {\n printJobNewRequest.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"File could not be uploaded\");\n\n if (printJobNewRequest.getFile() =...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_0
{ "fields": [ { "declarator": "customerInfoRepo", "modifier": "@Mock", "original_string": "@Mock\n CustomerInfoRepo customerInfoRepo;", "type": "CustomerInfoRepo", "var_name": "customerInfoRepo" }, { "declarator": "printJobRepo", "modifier": "@Mock", "ori...
{ "body": "@Test\n public void deleteUserInfo() {\n CustomerInfo ci = new CustomerInfo();\n ci.setCreatedAt(LocalDateTime.of(2019, Month.JANUARY, 1, 0, 0));\n \n List<CustomerInfo> customerInfoList = new ArrayList<>();\n customerInfoList.add(ci);\n\n PrintJob p = new Print...
{ "fields": [ { "declarator": "customerInfoRepo", "modifier": "private", "original_string": "private CustomerInfoRepo customerInfoRepo;", "type": "CustomerInfoRepo", "var_name": "customerInfoRepo" }, { "declarator": "printJobRepo", "modifier": "private", "or...
{ "body": "@Scheduled(cron = \"0 0 6 * * *\")\n public void deleteUserInfo() {\n LOGGER.info(\"Running cron job to delete users\");\n Iterable<CustomerInfo> customerInfoList = customerInfoRepo.findAll();\n List<CustomerInfoCronJobInfo> customersToDelete = new ArrayList<>();\n\n if (cust...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_48
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class) //ValidationException\n public void userSignUpFailValidation() {\n EmployeeSignUpRequest request = new EmployeeSignUpRequest();\n request.setUsername(\"username\");\n request.setPassword(null);\n request.setRole(\"ADMIN\");\n ...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse userSignUp(EmployeeSignUpRequest request) {\n request.validate();\n Employee login = fromEmployeeSignUpRequest(request);\n GenericResponse response = new GenericResponse();\n\n try {\n \tEmployee userFound = employeeRepo.findEmployeeByUsername(login...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_25
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void getAllPrintJobs_shouldThrow_IdeaLabApiException_when_printJob_is_not_exist(){\n // given\n when(printJobRepo.findActive()).thenReturn(null);\n\n // when\n operations.getAllPrintJobs(null);\n }", "class_method_sign...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getAllPrintJobs(String status) {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Could not get all print jobs\");\n\n List<PrintJob> printJobs = status == null? printJobRepo.findActive() : printJobRepo.findPrintJobByStatus(Status.f...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_33
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void updateModelSuccess() {\n byte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFile(\"something.stl\", \"something.stl\", null ,a);\n\n PrintModelUpdateRequest request = new PrintModelUpdateRequest();\n ...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updateModel(Integer printId, PrintModelUpdateRequest model){\n model.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Model could not be updated\");\n\n PrintJob printJob = printJobRepo.findPrintJobById(printId);\...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_32
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void createNewPrintJob5JobError() {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>();\n\n byte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFil...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> newPrintJob(PrintJobNewRequest printJobNewRequest, Principal principal) {\n printJobNewRequest.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"File could not be uploaded\");\n\n if (printJobNewRequest.getFile() =...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_24
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void getAllPrintJobsByStatus() throws Exception {\n // given\n PrintJob printJob = new PrintJob();\n\n printJob.setColorType(new ColorType(1, \"Red\"));\n printJob.setComments(\"comments\");\n printJob.setCreatedAt(LocalDateTime.now());\n printJob...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getAllPrintJobs(String status) {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Could not get all print jobs\");\n\n List<PrintJob> printJobs = status == null? printJobRepo.findActive() : printJobRepo.findPrintJobByStatus(Status.f...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_49
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userSignUpFail() {\n Employee e = new Employee();\n e.setPassword(\"password\");\n\n EmployeeSignUpRequest request = new EmployeeSignUpRequest();\n request.setUsername(\"username\");\n request.setPassword(\"password\");\n request.setRole(\"AD...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse userSignUp(EmployeeSignUpRequest request) {\n request.validate();\n Employee login = fromEmployeeSignUpRequest(request);\n GenericResponse response = new GenericResponse();\n\n try {\n \tEmployee userFound = employeeRepo.findEmployeeByUsername(login...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_28
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void createNewPrintJob() {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>();\n\n byte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFile(\"something.stl\", \"something.stl\", null ,a...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> newPrintJob(PrintJobNewRequest printJobNewRequest, Principal principal) {\n printJobNewRequest.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"File could not be uploaded\");\n\n if (printJobNewRequest.getFile() =...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_1
{ "fields": [ { "declarator": "customerInfoRepo", "modifier": "@Mock", "original_string": "@Mock\n CustomerInfoRepo customerInfoRepo;", "type": "CustomerInfoRepo", "var_name": "customerInfoRepo" }, { "declarator": "printJobRepo", "modifier": "@Mock", "ori...
{ "body": "@Test\n public void deleteUserInfoNoOlderUsers() {\n List<CustomerInfo> customerInfoList = new ArrayList<>();\n CustomerInfo ci = new CustomerInfo();\n ci.setCreatedAt(LocalDateTime.now());\n customerInfoList.add(ci);\n\n when(customerInfoRepo.findAll()).thenReturn(cus...
{ "fields": [ { "declarator": "customerInfoRepo", "modifier": "private", "original_string": "private CustomerInfoRepo customerInfoRepo;", "type": "CustomerInfoRepo", "var_name": "customerInfoRepo" }, { "declarator": "printJobRepo", "modifier": "private", "or...
{ "body": "@Scheduled(cron = \"0 0 6 * * *\")\n public void deleteUserInfo() {\n LOGGER.info(\"Running cron job to delete users\");\n Iterable<CustomerInfo> customerInfoList = customerInfoRepo.findAll();\n List<CustomerInfoCronJobInfo> customersToDelete = new ArrayList<>();\n\n if (cust...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_53
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void changePasswordSuccess() {\n UserChangePasswordRequest request = new UserChangePasswordRequest();\n request.setUsername(\"testuser\");\n request.setNewPassword(\"New1\");\n request.setConfirmNewPassword(\"New1\");\n\n Employee e = new Employee();\n ...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse changePassword(UserChangePasswordRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e != null) {\n if(request.getNewPassw...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_45
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private ColorTypeOperations operations;", "type": "ColorTypeOperations", "var_name": "operations" }, { "declarator": "colorTypeRepo", "modifier": "@Mock", "original_string...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void getActiveColors_shouldThrow_IdeaLabApiException_when_colors_dont_exist() {\n // given\n when(colorTypeRepo.findByAvailable(true)).thenReturn(null);\n\n // when\n operations.getActiveColors();\n }", "class_method_s...
{ "fields": [ { "declarator": "colorTypeRepo", "modifier": "private final", "original_string": "private final ColorTypeRepo colorTypeRepo;", "type": "ColorTypeRepo", "var_name": "colorTypeRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/ColorTypeOperations.jav...
{ "body": "public DataResponse<ColorType> getActiveColors() {\n DataResponse<ColorType> response = new DataResponse<ColorType>(\"Could not get color list\");\n\n List<ColorType> colors = colorTypeRepo.findByAvailable(true);\n\n if (colors == null || colors.isEmpty()){\n ErrorType.COLOR...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_12
{ "fields": [ { "declarator": "filePath", "modifier": "@Value(\"${dropbox.TEST_ABSOLUTE_FILE_PATH}\")\n private", "original_string": "@Value(\"${dropbox.TEST_ABSOLUTE_FILE_PATH}\")\n private String filePath;", "type": "String", "var_name": "filePath" }, { "declara...
{ "body": "@Test\n public void updateDropboxToken() throws Exception {\n propertyOperations.testUpdateDropboxToken(\"RANDOM\", \"dropbox.ACCESS_TOKEN\");\n }", "class_method_signature": "PropertyOperationsTest.updateDropboxToken()", "constructor": false, "full_signature": "@Test public void updateD...
{ "fields": [ { "declarator": "DROPBOX_PROPERTY_NAME = \"dropbox.ACCESS_TOKEN\"", "modifier": "private static final", "original_string": "private static final String DROPBOX_PROPERTY_NAME = \"dropbox.ACCESS_TOKEN\";", "type": "String", "var_name": "DROPBOX_PROPERTY_NAME" }, {...
{ "body": "public GenericResponse updateDropboxToken(String token) {\n String errorMessage = \"Dropbox token not updated: \";\n String successMessage = \"Dropbox token updated successfully\";\n return updateAnApplicationProperty(token, DROPBOX_PROPERTY_NAME, errorMessage, successMessage);\n }"...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_19
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void updatePrintJob_shouldThrow_IdeaLabApiException_when_requestStatus_is_invalid() {\n //Given\n PrintJobUpdateRequest request = new PrintJobUpdateRequest();\n request.setEmployeeId(1);\n request.setStatus(\"adfasfasf\");\...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse updatePrintJobStatus(Integer printId, PrintJobUpdateRequest dto) {\n dto.validate();\n Status requestStatus = Status.fromValue(dto.getStatus());\n\n if(requestStatus == null || !requestStatus.isValid()){\n ErrorType.REQUEST_STATUS_IS_NOT_VALID.throwExc...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_58
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void userUpdate_NotValidRole() {\n EmployeeUpdateRequest request = new EmployeeUpdateRequest();\n request.setUsername(\"username\");\n request.setRole(\"NOT_VALID\");\n\n GenericResponse response = operations.updateUser(req...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse updateUser(EmployeeUpdateRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e == null){\n throw new IdeaLabApiException...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_23
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void getAllPrintJobs(){\n // given\n PrintJob printJob = new PrintJob();\n\n printJob.setColorType(new ColorType(1, \"Red\"));\n printJob.setComments(\"comments\");\n printJob.setCreatedAt(LocalDateTime.now());\n printJob.setQueueId(new Queue(prin...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getAllPrintJobs(String status) {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Could not get all print jobs\");\n\n List<PrintJob> printJobs = status == null? printJobRepo.findActive() : printJobRepo.findPrintJobByStatus(Status.f...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_35
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void updateModelDropboxFail() {\n byte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFile(\"Something\", a);\n\n PrintModelUpdateRequest request = new PrintModelUpdateReq...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updateModel(Integer printId, PrintModelUpdateRequest model){\n model.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Model could not be updated\");\n\n PrintJob printJob = printJobRepo.findPrintJobById(printId);\...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_62
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private AuditOperations operations;", "type": "AuditOperations", "var_name": "operations" }, { "declarator": "entityManager", "modifier": "@Mock\n private", "original_s...
{ "body": "@Test\n public void printJobAuditByIdSuccess() {\n //Given\n PrintJobAuditModel auditModel = new PrintJobAuditModel();\n auditModel.setId(4);\n auditModel.setColor(\"blue\");\n auditModel.setEmailHash(\"no hash here\");\n\n List<PrintJobAuditModel> auditList = n...
{ "fields": [ { "declarator": "auditService", "modifier": "private final", "original_string": "private final AuditService auditService;", "type": "AuditService", "var_name": "auditService" } ], "file": "Backend/src/main/java/idealab/api/operations/AuditOperations.java", "id...
{ "body": "public PrintJobAuditResponse printJobAuditById(Integer printJobId){\n AuditQuery query = auditService.getPrintJobAuditQuery();\n query.addOrder(AuditEntity.revisionNumber().desc());\n\n //add method allows filtering, this is the only difference between getting all print jobs\n q...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_15
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private EmailMessageOperations operations;", "type": "EmailMessageOperations", "var_name": "operations" }, { "declarator": "repo", "modifier": "@Mock\n private", "origi...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void getMessageByStatus_MessageNotFound() {\n // given\n String status = \"COMPLETED\";\n Status requestStatus = Status.fromValue(status);\n EmailMessage emailMessage = null;\n\n // when\n when(repo.findEmailM...
{ "fields": [ { "declarator": "emailMessageRepo", "modifier": "private final", "original_string": "private final EmailMessageRepo emailMessageRepo;", "type": "EmailMessageRepo", "var_name": "emailMessageRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/EmailMes...
{ "body": "public EmailMessageResponse getMessageByStatus(String status){\n Status requestStatus = Status.fromValue(status);\n\n if(requestStatus == null || !requestStatus.isValid()){\n ErrorType.REQUEST_STATUS_IS_NOT_VALID.throwException();\n }\n\n EmailMessage emailMessage = e...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_42
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void getPrintJobById_shouldReturnPrintJob() {\n //Given\n PrintJob printJob = new PrintJob();\n printJob.setId(2);\n printJob.setStatus(Status.COMPLETED);\n\n //When\n when(printJobRepo.findPrintJobById(anyInt())).thenReturn(printJob);\n\n ...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getPrintJobById(Integer printJobId){\n PrintJob printJob = printJobRepo.findPrintJobById(printJobId);\n if(printJob == null)\n throw new IdeaLabApiException(PRINT_JOB_CANT_FIND_BY_ID);\n\n List<PrintJob> printJobs = new ArrayList<>();\n ...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_54
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void changePasswordInvalidEmployee() {\n UserChangePasswordRequest request = new UserChangePasswordRequest();\n request.setUsername(\"testuser\");\n request.setNewPassword(\"New1\");\n request.setConfirmNewPassword(\"New1\"...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse changePassword(UserChangePasswordRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e != null) {\n if(request.getNewPassw...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_6
{ "fields": [ { "declarator": "mockMvc", "modifier": "private", "original_string": "private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "original_string": "@Mock\n private ...
{ "body": "@Test\n public void updateMessageController() throws Exception {\n // given\n EmailMessageUpdateRequest request = new EmailMessageUpdateRequest();\n request.setStatus(\"COMPLETED\");\n request.setEmailMessage(\"EMAIL MESSAGE RESPONSE\");\n String inputJson = requestAsJ...
{ "fields": [ { "declarator": "emailMessageOperations", "modifier": "private final", "original_string": "private final EmailMessageOperations emailMessageOperations;", "type": "EmailMessageOperations", "var_name": "emailMessageOperations" } ], "file": "Backend/src/main/java/i...
{ "body": "@PutMapping()\n public ResponseEntity<?> updateMessageController(@RequestBody EmailMessageUpdateRequest emailMessageUpdateRequest) {\n EmailMessageResponse response = emailMessageOperations.updateMessage(emailMessageUpdateRequest);\n return new ResponseEntity<>(response, response.getHttpSt...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_39
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void updatePrintJobColorProp() {\n UpdatePrintJobPropertiesRequest request = new UpdatePrintJobPropertiesRequest();\n request.setColorType(\"red\");\n request.setEmployeeId(1);\n\n PrintJob printJob = new PrintJob();\n printJob.setComments(\"old comments...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updatePrintJobProps(Integer printJobId, UpdatePrintJobPropertiesRequest request) {\n request.validate();\n boolean isChanged = false;\n PrintJob printJob = printJobRepo.findPrintJobById(printJobId);\n if(printJob == null)\n throw new...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_38
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void updatePrintJobProps() {\n UpdatePrintJobPropertiesRequest request = new UpdatePrintJobPropertiesRequest();\n request.setColorType(\"red\");\n request.setComments(\"comments\");\n request.setStatus(\"REJECTED\");\n request.setEmployeeId(1);\n\n ...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updatePrintJobProps(Integer printJobId, UpdatePrintJobPropertiesRequest request) {\n request.validate();\n boolean isChanged = false;\n PrintJob printJob = printJobRepo.findPrintJobById(printJobId);\n if(printJob == null)\n throw new...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_7
{ "fields": [ { "declarator": "mockMvc", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "origin...
{ "body": "@Test\n public void userDelete() throws Exception {\n GenericResponse genericResponse = new GenericResponse();\n genericResponse.setSuccess(true);\n genericResponse.setMessage(\"Employee Deleted Successfully\");\n genericResponse.setHttpStatus(HttpStatus.ACCEPTED);\n\n ...
{ "fields": [ { "declarator": "userOperations", "modifier": "private", "original_string": "private UserOperations userOperations;", "type": "UserOperations", "var_name": "userOperations" } ], "file": "Backend/src/main/java/idealab/api/controller/UserController.java", "ident...
{ "body": "@DeleteMapping(\"/{id}\")\n public ResponseEntity<?> deleteUser(@PathVariable(\"id\") Integer id) {\n GenericResponse response = userOperations.deleteUser(id);\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_method_signature": "UserController.deleteUser...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_55
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void changePasswordNewPasswordNoMatch() {\n UserChangePasswordRequest request = new UserChangePasswordRequest();\n request.setUsername(\"testuser\");\n request.setNewPassword(\"New1\");\n request.setConfirmNewPassword(\"New...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse changePassword(UserChangePasswordRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e != null) {\n if(request.getNewPassw...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_43
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void getPrintJobById_shouldThrowException() {\n //When\n when(printJobRepo.findPrintJobById(anyInt())).thenReturn(null);\n\n DataResponse<BasicPrintJob> printJobResponse = operations.getPrintJobById(2);\n }", "class_method_si...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getPrintJobById(Integer printJobId){\n PrintJob printJob = printJobRepo.findPrintJobById(printJobId);\n if(printJob == null)\n throw new IdeaLabApiException(PRINT_JOB_CANT_FIND_BY_ID);\n\n List<PrintJob> printJobs = new ArrayList<>();\n ...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_14
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private EmailMessageOperations operations;", "type": "EmailMessageOperations", "var_name": "operations" }, { "declarator": "repo", "modifier": "@Mock\n private", "origi...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void getMessageByStatus_StatusNotValid() {\n // given\n String status = \"COMPLETED\";\n Status requestStatus = Status.fromValue(status);\n EmailMessage emailMessage = new EmailMessage(Status.fromValue(\"COMPLETED\"), \"EMA...
{ "fields": [ { "declarator": "emailMessageRepo", "modifier": "private final", "original_string": "private final EmailMessageRepo emailMessageRepo;", "type": "EmailMessageRepo", "var_name": "emailMessageRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/EmailMes...
{ "body": "public EmailMessageResponse getMessageByStatus(String status){\n Status requestStatus = Status.fromValue(status);\n\n if(requestStatus == null || !requestStatus.isValid()){\n ErrorType.REQUEST_STATUS_IS_NOT_VALID.throwException();\n }\n\n EmailMessage emailMessage = e...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_34
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void updateModelPrintJobNotFound() {\n byte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFile(\"Something\", a);\n\n PrintModelUpdateRequest request = new PrintModelUpda...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updateModel(Integer printId, PrintModelUpdateRequest model){\n model.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Model could not be updated\");\n\n PrintJob printJob = printJobRepo.findPrintJobById(printId);\...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_22
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void deletePrintJob_shouldThrow_IdeaLabApiException_when_printJob_is_not_exist() {\n PrintJobDeleteRequest request = new PrintJobDeleteRequest();\n request.setEmployeeId(1);\n request.setPrintJobId(2);\n\n Employee employee...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse deletePrintJob(PrintJobDeleteRequest dto) {\n dto.validate();\n Employee employee = employeeRepo.findEmployeeById(dto.getEmployeeId());\n PrintJob printJob = printJobRepo.findPrintJobById(dto.getPrintJobId());\n\n if(employee == null || printJob == null){\...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_59
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void userUpdate_NoUsername() {\n EmployeeUpdateRequest request = new EmployeeUpdateRequest();\n request.setRole(\"ADMIN\");\n\n GenericResponse response = operations.updateUser(request);\n\n }", "class_method_signature": "Use...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse updateUser(EmployeeUpdateRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e == null){\n throw new IdeaLabApiException...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_18
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void updatePrintJobSuccess() {\n //Given\n PrintJobUpdateRequest request = new PrintJobUpdateRequest();\n request.setEmployeeId(1);\n request.setStatus(\"Completed\");\n\n Employee employee = new Employee();\n employee.setId(1);\n\n PrintJo...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse updatePrintJobStatus(Integer printId, PrintJobUpdateRequest dto) {\n dto.validate();\n Status requestStatus = Status.fromValue(dto.getStatus());\n\n if(requestStatus == null || !requestStatus.isValid()){\n ErrorType.REQUEST_STATUS_IS_NOT_VALID.throwExc...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_60
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void userUpdate_NotValidUsername() {\n EmployeeUpdateRequest request = new EmployeeUpdateRequest();\n request.setUsername(\"username\");\n request.setRole(\"ADMIN\");\n\n Employee e = new Employee();\n e.setUsername(...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse updateUser(EmployeeUpdateRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e == null){\n throw new IdeaLabApiException...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_37
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void deleteModelPrintJobNotFound() {\n PrintJob printJob = new PrintJob();\n printJob.setId(999);\n\n when(printJobRepo.findPrintJobById(printJob.getId())).thenReturn(null);\n\n operations.deleteModel(printJob.getId());\n ...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse deleteModel(Integer printId) {\n GenericResponse response = new GenericResponse();\n response.setSuccess(false);\n response.setMessage(\"File could not be deleted\");\n response.setHttpStatus(HttpStatus.BAD_REQUEST);\n\n PrintJob printJob = printJob...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_8
{ "fields": [ { "declarator": "mockMvc", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "origin...
{ "body": "@Test\n public void userDeleteFailNonUser() throws Exception {\n GenericResponse genericResponse = new GenericResponse();\n genericResponse.setSuccess(false);\n genericResponse.setMessage(\"Employee ID is not valid\");\n genericResponse.setHttpStatus(HttpStatus.BAD_REQUEST);\...
{ "fields": [ { "declarator": "userOperations", "modifier": "private", "original_string": "private UserOperations userOperations;", "type": "UserOperations", "var_name": "userOperations" } ], "file": "Backend/src/main/java/idealab/api/controller/UserController.java", "ident...
{ "body": "@DeleteMapping(\"/{id}\")\n public ResponseEntity<?> deleteUser(@PathVariable(\"id\") Integer id) {\n GenericResponse response = userOperations.deleteUser(id);\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_method_signature": "UserController.deleteUser...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_21
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void deletePrintJob_shouldThrow_IdeaLabApiException_when_employee_is_not_exist() {\n // given\n PrintJobDeleteRequest request = new PrintJobDeleteRequest();\n request.setEmployeeId(1);\n request.setPrintJobId(2);\n\n ...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse deletePrintJob(PrintJobDeleteRequest dto) {\n dto.validate();\n Employee employee = employeeRepo.findEmployeeById(dto.getEmployeeId());\n PrintJob printJob = printJobRepo.findPrintJobById(dto.getPrintJobId());\n\n if(employee == null || printJob == null){\...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_4
{ "fields": [ { "declarator": "mockMvc", "modifier": "private", "original_string": "private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "printJobOperations", "modifier": "@Mock\n private", "original_string": "@Mock\n ...
{ "body": "@Test\n\t public void getDeletablePrintJobs() throws Exception {\n\t // given\n CustomerInfo customerInfo = new CustomerInfo();\n customerInfo.setId(1);\n\n\t\t PrintJob printJob = new PrintJob();\n\t\t\n\t\t printJob.setColorType(new ColorType(1, \"Red\"));\n\t\t printJob.setComments(\...
{ "fields": [ { "declarator": "LOGGER = LoggerFactory.getLogger(PrintJobController.class)", "modifier": "private static final", "original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(PrintJobController.class);", "type": "Logger", "var_name": "LOGGER" }, ...
{ "body": "@GetMapping(\"/deletable\")\n public ResponseEntity<?> getDeletablePrintJobs() {\n LOGGER.info(\"getDeletablePrintJobs \");\n\n DataResponse<BasicPrintJob> response = printJobOperations.getDeletablePrintJobs();\n\n return new ResponseEntity<>(response, response.getHttpStatus());\n ...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_56
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userUpdate() {\n EmployeeUpdateRequest request = new EmployeeUpdateRequest();\n request.setUsername(\"username\");\n request.setRole(\"ADMIN\");\n\n Employee e = new Employee();\n e.setUsername(\"username\");\n e.setRole(EmployeeRole.STAFF);\...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse updateUser(EmployeeUpdateRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e == null){\n throw new IdeaLabApiException...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_40
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void updatePrintJobStatusProp() {\n UpdatePrintJobPropertiesRequest request = new UpdatePrintJobPropertiesRequest();\n request.setStatus(\"REJECTED\");\n request.setEmployeeId(1);\n\n PrintJob printJob = new PrintJob();\n printJob.setComments(\"old comme...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updatePrintJobProps(Integer printJobId, UpdatePrintJobPropertiesRequest request) {\n request.validate();\n boolean isChanged = false;\n PrintJob printJob = printJobRepo.findPrintJobById(printJobId);\n if(printJob == null)\n throw new...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_17
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private EmailMessageOperations operations;", "type": "EmailMessageOperations", "var_name": "operations" }, { "declarator": "repo", "modifier": "@Mock\n private", "origi...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void updateMessage_MessageNotFound() {\n // given\n EmailMessageUpdateRequest request = new EmailMessageUpdateRequest();\n request.setStatus(\"COMPLETED\");\n request.setEmailMessage(\"EMAIL MESSAGE RESPONSE\");\n\n ...
{ "fields": [ { "declarator": "emailMessageRepo", "modifier": "private final", "original_string": "private final EmailMessageRepo emailMessageRepo;", "type": "EmailMessageRepo", "var_name": "emailMessageRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/EmailMes...
{ "body": "public EmailMessageResponse updateMessage(EmailMessageUpdateRequest req){\n req.validate();\n \n Status requestStatus = Status.fromValue(req.getStatus());\n EmailMessage emailMessage = emailMessageRepo.findEmailMessageByStatus(requestStatus);\n if(emailMessage == null){\n...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_16
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private EmailMessageOperations operations;", "type": "EmailMessageOperations", "var_name": "operations" }, { "declarator": "repo", "modifier": "@Mock\n private", "origi...
{ "body": "@Test\n public void updateMessage() throws Exception {\n // given\n EmailMessageUpdateRequest request = new EmailMessageUpdateRequest();\n request.setStatus(\"COMPLETED\");\n request.setEmailMessage(\"EMAIL MESSAGE RESPONSE\");\n\n Status requestStatus = Status.fromVal...
{ "fields": [ { "declarator": "emailMessageRepo", "modifier": "private final", "original_string": "private final EmailMessageRepo emailMessageRepo;", "type": "EmailMessageRepo", "var_name": "emailMessageRepo" } ], "file": "Backend/src/main/java/idealab/api/operations/EmailMes...
{ "body": "public EmailMessageResponse updateMessage(EmailMessageUpdateRequest req){\n req.validate();\n \n Status requestStatus = Status.fromValue(req.getStatus());\n EmailMessage emailMessage = emailMessageRepo.findEmailMessageByStatus(requestStatus);\n if(emailMessage == null){\n...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_41
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void updatePrintJobCommentsProp() {\n UpdatePrintJobPropertiesRequest request = new UpdatePrintJobPropertiesRequest();\n request.setComments(\"comments\");\n request.setEmployeeId(1);\n\n PrintJob printJob = new PrintJob();\n printJob.setComments(\"old c...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> updatePrintJobProps(Integer printJobId, UpdatePrintJobPropertiesRequest request) {\n request.validate();\n boolean isChanged = false;\n PrintJob printJob = printJobRepo.findPrintJobById(printJobId);\n if(printJob == null)\n throw new...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_57
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void userUpdate_NoRole() {\n EmployeeUpdateRequest request = new EmployeeUpdateRequest();\n request.setUsername(\"username\");\n\n GenericResponse response = operations.updateUser(request);\n\n }", "class_method_signature": "...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse updateUser(EmployeeUpdateRequest request) {\n request.validate();\n GenericResponse response = new GenericResponse();\n\n Employee e = employeeRepo.findEmployeeByUsername(request.getUsername());\n\n if(e == null){\n throw new IdeaLabApiException...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_5
{ "fields": [ { "declarator": "mockMvc", "modifier": "private", "original_string": "private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "original_string": "@Mock\n private ...
{ "body": "@Test\n public void getMessageByStatusController() throws Exception {\n // given\n EmailMessage emailMessage = new EmailMessage(Status.fromValue(\"COMPLETED\"), \"EMAIL MESSAGE RESPONSE\");\n\n EmailMessageResponse expectedResponse = new EmailMessageResponse(emailMessage);\n\n ...
{ "fields": [ { "declarator": "emailMessageOperations", "modifier": "private final", "original_string": "private final EmailMessageOperations emailMessageOperations;", "type": "EmailMessageOperations", "var_name": "emailMessageOperations" } ], "file": "Backend/src/main/java/i...
{ "body": "@GetMapping()\n public ResponseEntity<?> getMessageByStatusController(@RequestParam(required = true) String status) {\n EmailMessageResponse response = emailMessageOperations.getMessageByStatus(status);\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_me...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_9
{ "fields": [ { "declarator": "mockMvc", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "origin...
{ "body": "@Test\n public void userDeleteFail() throws Exception {\n GenericResponse genericResponse = new GenericResponse();\n genericResponse.setSuccess(false);\n genericResponse.setMessage(\"Employee Could Not Be Deleted\");\n genericResponse.setHttpStatus(HttpStatus.BAD_REQUEST);\n\...
{ "fields": [ { "declarator": "userOperations", "modifier": "private", "original_string": "private UserOperations userOperations;", "type": "UserOperations", "var_name": "userOperations" } ], "file": "Backend/src/main/java/idealab/api/controller/UserController.java", "ident...
{ "body": "@DeleteMapping(\"/{id}\")\n public ResponseEntity<?> deleteUser(@PathVariable(\"id\") Integer id) {\n GenericResponse response = userOperations.deleteUser(id);\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_method_signature": "UserController.deleteUser...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_20
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void deletePrintJobSuccess() {\n PrintJobDeleteRequest request = new PrintJobDeleteRequest();\n request.setEmployeeId(1);\n request.setPrintJobId(2);\n\n Employee employee = new Employee();\n employee.setId(1);\n\n PrintJob printJob = new PrintJob...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse deletePrintJob(PrintJobDeleteRequest dto) {\n dto.validate();\n Employee employee = employeeRepo.findEmployeeById(dto.getEmployeeId());\n PrintJob printJob = printJobRepo.findPrintJobById(dto.getPrintJobId());\n\n if(employee == null || printJob == null){\...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_36
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void deleteModelSuccess() {\n GenericResponse response = new GenericResponse();\n response.setSuccess(true);\n response.setMessage(\"Successfully deleted file from DropBox\");\n response.setHttpStatus(HttpStatus.ACCEPTED);\n\n PrintJob printJob = new Pri...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public GenericResponse deleteModel(Integer printId) {\n GenericResponse response = new GenericResponse();\n response.setSuccess(false);\n response.setMessage(\"File could not be deleted\");\n response.setHttpStatus(HttpStatus.BAD_REQUEST);\n\n PrintJob printJob = printJob...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_61
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private AuditOperations operations;", "type": "AuditOperations", "var_name": "operations" }, { "declarator": "entityManager", "modifier": "@Mock\n private", "original_s...
{ "body": "@Test\n public void allPrintJobsAuditSuccess() {\n //Given\n PrintJobAuditModel auditModel = new PrintJobAuditModel();\n auditModel.setId(3);\n auditModel.setColor(\"red\");\n auditModel.setEmailHash(\"no hash here\");\n\n List<PrintJobAuditModel> auditList = ne...
{ "fields": [ { "declarator": "auditService", "modifier": "private final", "original_string": "private final AuditService auditService;", "type": "AuditService", "var_name": "auditService" } ], "file": "Backend/src/main/java/idealab/api/operations/AuditOperations.java", "id...
{ "body": "public PrintJobAuditResponse allPrintJobsAudit(){\n AuditQuery query = auditService.getPrintJobAuditQuery();\n query.addOrder(AuditEntity.revisionNumber().desc());\n\n List<PrintJobAuditModel> auditList = auditService.processPrintJobAuditQuery(query);\n return new PrintJobAuditR...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_2
{ "fields": [ { "declarator": "customerInfoRepo", "modifier": "@Mock", "original_string": "@Mock\n CustomerInfoRepo customerInfoRepo;", "type": "CustomerInfoRepo", "var_name": "customerInfoRepo" }, { "declarator": "printJobRepo", "modifier": "@Mock", "ori...
{ "body": "@Test\n public void deleteUserInfoNoUsers() {\n when(customerInfoRepo.findAll()).thenReturn(null);\n doNothing().when(customerInfoRepo).deleteById(anyInt());\n doNothing().when(printJobRepo).deleteAll(any());\n\n cronJob.deleteUserInfo();\n }", "class_method_signature": ...
{ "fields": [ { "declarator": "customerInfoRepo", "modifier": "private", "original_string": "private CustomerInfoRepo customerInfoRepo;", "type": "CustomerInfoRepo", "var_name": "customerInfoRepo" }, { "declarator": "printJobRepo", "modifier": "private", "or...
{ "body": "@Scheduled(cron = \"0 0 6 * * *\")\n public void deleteUserInfo() {\n LOGGER.info(\"Running cron job to delete users\");\n Iterable<CustomerInfo> customerInfoList = customerInfoRepo.findAll();\n List<CustomerInfoCronJobInfo> customersToDelete = new ArrayList<>();\n\n if (cust...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_50
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userDelete() {\n Employee e = new Employee();\n e.setId(1);\n\n when(employeeRepo.findEmployeeById(e.getId())).thenReturn(e);\n doNothing().when(employeeRepo).deleteById(e.getId());\n\n GenericResponse response = operations.deleteUser(e.getId());\n\...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse deleteUser(Integer id) {\n GenericResponse response = new GenericResponse();\n Employee e = employeeRepo.findEmployeeById(id);\n\n if(e != null) {\n try {\n employeeRepo.deleteById(id);\n response.setSuccess(true);\n ...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_46
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userSignUp() {\n Employee e = new Employee();\n e.setPassword(\"password\");\n\n EmployeeSignUpRequest request = new EmployeeSignUpRequest();\n request.setUsername(\"username\");\n request.setPassword(\"password\");\n request.setRole(\"ADMIN\...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse userSignUp(EmployeeSignUpRequest request) {\n request.validate();\n Employee login = fromEmployeeSignUpRequest(request);\n GenericResponse response = new GenericResponse();\n\n try {\n \tEmployee userFound = employeeRepo.findEmployeeByUsername(login...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_11
{ "fields": [ { "declarator": "mockMvc", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "origin...
{ "body": "@Test\n public void employeeUpdate_UpdateFailed() throws Exception {\n GenericResponse genericResponse = new GenericResponse();\n genericResponse.setSuccess(false);\n genericResponse.setMessage(\"Employee Successful\");\n genericResponse.setHttpStatus(HttpStatus.BAD_REQUEST)...
{ "fields": [ { "declarator": "userOperations", "modifier": "private", "original_string": "private UserOperations userOperations;", "type": "UserOperations", "var_name": "userOperations" } ], "file": "Backend/src/main/java/idealab/api/controller/UserController.java", "ident...
{ "body": "@PutMapping(\"/update\")\n public ResponseEntity<?> updateUser(@RequestBody EmployeeUpdateRequest request) {\n GenericResponse response = userOperations.updateUser(request);\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_method_signature": "UserControl...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_31
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void createNewPrintJobNullFile() {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>();\n response.setHttpStatus(HttpStatus.BAD_REQUEST);\n response.setMessage(\"No file was submitted. Please attach a file ...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> newPrintJob(PrintJobNewRequest printJobNewRequest, Principal principal) {\n printJobNewRequest.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"File could not be uploaded\");\n\n if (printJobNewRequest.getFile() =...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_27
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test\n public void getDeletablePrintJobs(){\n // given\n PrintJob printJob = new PrintJob();\n\n printJob.setColorType(new ColorType(1, \"Red\"));\n printJob.setComments(\"comments\");\n printJob.setCreatedAt(LocalDateTime.now());\n printJob.setQueueId(new Queu...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getDeletablePrintJobs() {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Could not get deletable print jobs\");\n List<Status> deletableStatuses = Arrays.asList(Status.PENDING_REVIEW,\n Status.FAILED,\n Statu...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_26
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void getAllPrintJobs_shouldThrow_IdeaLabApiException_when_empty_printJobs_returned(){\n // given\n when(printJobRepo.findActive()).thenReturn(new ArrayList<>());\n\n // when\n operations.getAllPrintJobs(null);\n\n //...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> getAllPrintJobs(String status) {\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"Could not get all print jobs\");\n\n List<PrintJob> printJobs = status == null? printJobRepo.findActive() : printJobRepo.findPrintJobByStatus(Status.f...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_30
{ "fields": [ { "declarator": "operations", "modifier": "private", "original_string": "private PrintJobOperations operations;", "type": "PrintJobOperations", "var_name": "operations" }, { "declarator": "printJobRepo", "modifier": "@Mock", "original_string": ...
{ "body": "@Test(expected = IdeaLabApiException.class)\n public void createNewPrintJobWithNotFoundColor() {\n \t// given\n \tbyte[] a = hexStringToByteArray(\"e04fd020ea3a6910a2d808002b30309d\");\n MultipartFile file = new MockMultipartFile(\"Something.stl\", a);\n\n Principal principal = null;...
{ "fields": [ { "declarator": "fileService", "modifier": "private final", "original_string": "private final FileService fileService;", "type": "FileService", "var_name": "fileService" }, { "declarator": "printJobRepo", "modifier": "private final", "original_...
{ "body": "public DataResponse<BasicPrintJob> newPrintJob(PrintJobNewRequest printJobNewRequest, Principal principal) {\n printJobNewRequest.validate();\n DataResponse<BasicPrintJob> response = new DataResponse<BasicPrintJob>(\"File could not be uploaded\");\n\n if (printJobNewRequest.getFile() =...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_10
{ "fields": [ { "declarator": "mockMvc", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "origin...
{ "body": "@Test\n public void employeeUpdate() throws Exception {\n GenericResponse genericResponse = new GenericResponse();\n genericResponse.setSuccess(true);\n genericResponse.setMessage(\"Employee Updated Successful\");\n genericResponse.setHttpStatus(HttpStatus.ACCEPTED);\n\n ...
{ "fields": [ { "declarator": "userOperations", "modifier": "private", "original_string": "private UserOperations userOperations;", "type": "UserOperations", "var_name": "userOperations" } ], "file": "Backend/src/main/java/idealab/api/controller/UserController.java", "ident...
{ "body": "@PutMapping(\"/update\")\n public ResponseEntity<?> updateUser(@RequestBody EmployeeUpdateRequest request) {\n GenericResponse response = userOperations.updateUser(request);\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_method_signature": "UserControl...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_47
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userSignUpWithAnExistingUser() {\n \t// given\n \tEmployee e = new Employee();\n \te.setUsername(\"username\");\n e.setPassword(\"password\");\n\n EmployeeSignUpRequest request = new EmployeeSignUpRequest();\n request.setUsername(\"username\");\n ...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse userSignUp(EmployeeSignUpRequest request) {\n request.validate();\n Employee login = fromEmployeeSignUpRequest(request);\n GenericResponse response = new GenericResponse();\n\n try {\n \tEmployee userFound = employeeRepo.findEmployeeByUsername(login...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_51
{ "fields": [ { "declarator": "operations", "modifier": "@InjectMocks", "original_string": "@InjectMocks\n UserOperations operations;", "type": "UserOperations", "var_name": "operations" }, { "declarator": "employeeRepo", "modifier": "@Mock\n private", ...
{ "body": "@Test\n public void userDeleteFailNonEmployee() {\n when(employeeRepo.findEmployeeById(1)).thenReturn(null);\n\n GenericResponse response = operations.deleteUser(1);\n\n assertTrue(response.isSuccess() == false);\n assertTrue(response.getMessage().equalsIgnoreCase(\"Employee ...
{ "fields": [ { "declarator": "employeeRepo", "modifier": "private", "original_string": "private EmployeeRepo employeeRepo;", "type": "EmployeeRepo", "var_name": "employeeRepo" }, { "declarator": "encoder", "modifier": "private", "original_string": "private ...
{ "body": "public GenericResponse deleteUser(Integer id) {\n GenericResponse response = new GenericResponse();\n Employee e = employeeRepo.findEmployeeById(id);\n\n if(e != null) {\n try {\n employeeRepo.deleteById(id);\n response.setSuccess(true);\n ...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
200539506_3
{ "fields": [ { "declarator": "mockMvc", "modifier": "private", "original_string": "private MockMvc mockMvc;", "type": "MockMvc", "var_name": "mockMvc" }, { "declarator": "operations", "modifier": "@Mock\n private", "original_string": "@Mock\n private ...
{ "body": "@Test\n public void getAllAvailableColors() throws Exception {\n // given\n ColorType color = new ColorType(1, \"yellow\");\n\n List<ColorType> colorList = Arrays.asList(color);\n\n DataResponse<ColorType> expectedResponse = new DataResponse<ColorType>();\n expectedRes...
{ "fields": [ { "declarator": "colorOperations", "modifier": "private", "original_string": "private ColorTypeOperations colorOperations;", "type": "ColorTypeOperations", "var_name": "colorOperations" } ], "file": "Backend/src/main/java/idealab/api/controller/ColorTypeControll...
{ "body": "@GetMapping(\"/active\")\n public ResponseEntity<?> getActiveColors() {\n DataResponse<ColorType> response = colorOperations.getActiveColors();\n\n return new ResponseEntity<>(response, response.getHttpStatus());\n }", "class_method_signature": "ColorTypeController.getActiveColors()",...
{ "created": null, "fork": null, "fork_count": 15, "is_fork": false, "language": "Java", "license": "MIT License", "repo_id": 200539506, "size": 28598, "stargazer_count": 10, "stars": null, "updates": null, "url": "https://github.com/codefordenver/ideaLab" }
12796207_6
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void isEmpty() {\n final History.Builder builder = History.emptyBuilder();\n assertThat(builder.isEmpty()).isTrue();\n builder.push(\"foo\");\n assertThat(builder.isEmpty()).isFalse();\n builder.pop();\n assertThat(builder.isEmpty()).isTrue();\n }", "class_method_signature...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@NonNull public static Builder emptyBuilder() {\n return new Builder(Collections.emptyList());\n }", "class_method_signature": "History.emptyBuilder()", "constructor": false, "full_signature": "@NonNull public static Builder emptyBuilder()", "identifier": "emptyBuilder", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_7
{ "fields": [ { "declarator": "able = new TestKey(\"Able\")", "modifier": "final", "original_string": "final TestKey able = new TestKey(\"Able\");", "type": "TestKey", "var_name": "able" }, { "declarator": "baker = new TestKey(\"Baker\")", "modifier": "final", ...
{ "body": "@Test public void incorrectFlowGetUsage() {\n Context mockContext = Mockito.mock(Context.class);\n //noinspection WrongConstant\n Mockito.when(mockContext.getSystemService(Mockito.anyString())).thenReturn(null);\n\n try {\n Flow.get(mockContext);\n\n fail(\"Flow was supposed to throw ...
{ "fields": [ { "declarator": "ROOT_KEY = new Object() {\n @Override public String toString() {\n return Flow.class.getName() + \".ROOT_KEY\";\n }\n }", "modifier": "static final", "original_string": "static final Object ROOT_KEY = new Object() {\n @Override public String toString...
{ "body": "@NonNull public static Flow get(@NonNull View view) {\n return get(view.getContext());\n }", "class_method_signature": "Flow.get(@NonNull View view)", "constructor": false, "full_signature": "@NonNull public static Flow get(@NonNull View view)", "identifier": "get", "invocations": [ "get"...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_0
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void builderPopToExplodesOnMissingState() {\n History.Builder builder = History.emptyBuilder();\n builder.push(ABLE);\n builder.push(BAKER);\n builder.push(CHARLIE);\n try {\n builder.popTo(new Object());\n fail(\"Missing state object, should have thrown\");\n } cat...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@NonNull public static Builder emptyBuilder() {\n return new Builder(Collections.emptyList());\n }", "class_method_signature": "History.emptyBuilder()", "constructor": false, "full_signature": "@NonNull public static Builder emptyBuilder()", "identifier": "emptyBuilder", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_1
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void builderPopExplodesIfCountIsTooLarge() {\n History.Builder builder = History.emptyBuilder();\n builder.push(ABLE);\n builder.push(BAKER);\n builder.push(CHARLIE);\n try {\n builder.pop(4);\n fail(\"Count is too large, should have thrown\");\n } catch (IllegalArg...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@NonNull public static Builder emptyBuilder() {\n return new Builder(Collections.emptyList());\n }", "class_method_signature": "History.emptyBuilder()", "constructor": false, "full_signature": "@NonNull public static Builder emptyBuilder()", "identifier": "emptyBuilder", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_2
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void framesFromBottom() {\n List<Object> paths = new ArrayList<>(Arrays.<Object>asList(ABLE, BAKER, CHARLIE));\n History history = History.emptyBuilder().pushAll(paths).build();\n Iterator<Object> iterator = history.framesFromBottom().iterator();\n\n assertThat(iterator.next()).isS...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@NonNull public <T> Iterable<T> framesFromBottom() {\n return new HistoryIterable<>(history, true);\n }", "class_method_signature": "History.framesFromBottom()", "constructor": false, "full_signature": "@NonNull public Iterable<T> framesFromBottom()", "identifier": "framesFromBottom", "invoca...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_3
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void reverseIterator() {\n List<Object> paths = new ArrayList<>(Arrays.<Object>asList(ABLE, BAKER, CHARLIE));\n History history = History.emptyBuilder().pushAll(paths).build();\n Iterator<Object> i = history.reverseIterator();\n while (i.hasNext()) {\n assertThat(i.next()).isS...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@Deprecated @NonNull public <T> Iterator<T> reverseIterator() {\n return iterateFromBottom(history);\n }", "class_method_signature": "History.reverseIterator()", "constructor": false, "full_signature": "@Deprecated @NonNull public Iterator<T> reverseIterator()", "identifier": "reverseIterator",...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_4
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void framesFromTop() {\n List<Object> paths = new ArrayList<>(Arrays.<Object>asList(ABLE, BAKER, CHARLIE));\n History history = History.emptyBuilder().pushAll(paths).build();\n Iterator<Object> iterator = history.framesFromTop().iterator();\n\n assertThat(iterator.next()).isSameAs(...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@NonNull public <T> Iterable<T> framesFromTop() {\n return new HistoryIterable<>(history, false);\n }", "class_method_signature": "History.framesFromTop()", "constructor": false, "full_signature": "@NonNull public Iterable<T> framesFromTop()", "identifier": "framesFromTop", "invocations": [],...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
12796207_5
{ "fields": [ { "declarator": "ABLE = new TestKey(\"able\")", "modifier": "private static final", "original_string": "private static final TestKey ABLE = new TestKey(\"able\");", "type": "TestKey", "var_name": "ABLE" }, { "declarator": "BAKER = new TestKey(\"baker\")", ...
{ "body": "@Test public void emptyBuilderPopThrows() {\n try {\n History.emptyBuilder().pop();\n fail(\"Should throw\");\n } catch (IllegalStateException e) {\n // pass\n }\n }", "class_method_signature": "HistoryTest.emptyBuilderPopThrows()", "constructor": false, "full_signature": "@T...
{ "fields": [ { "declarator": "history", "modifier": "private final", "original_string": "private final List<Object> history;", "type": "List<Object>", "var_name": "history" } ], "file": "flow/src/main/java/flow/History.java", "identifier": "History", "interfaces": "imple...
{ "body": "@NonNull public static Builder emptyBuilder() {\n return new Builder(Collections.emptyList());\n }", "class_method_signature": "History.emptyBuilder()", "constructor": false, "full_signature": "@NonNull public static Builder emptyBuilder()", "identifier": "emptyBuilder", "invocations": [ ...
{ "created": null, "fork": null, "fork_count": 259, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 12796207, "size": 974, "stargazer_count": 2798, "stars": null, "updates": null, "url": "https://github.com/square/flow" }
68459222_0
{ "fields": [], "file": "app/src/test/java/io/github/kobakei/anago/util/NetUtilTest.java", "identifier": "NetUtilTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getBasicHeader_isSuccess() {\n Assert.assertEquals(\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\", NetUtil.getBasicHeader(\"Aladdin\", \"open sesame\"));\n }", "class_method_signature": "NetUtilTest.getBasicHeader_isSuccess()", "constructor": false, "full_signature": "@Test p...
{ "fields": [], "file": "app/src/main/java/io/github/kobakei/anago/util/NetUtil.java", "identifier": "NetUtil", "interfaces": "", "methods": [ { "class_method_signature": "NetUtil.getBasicHeader(String name, String password)", "constructor": false, "full_signature": "public static String...
{ "body": "public static String getBasicHeader(String name, String password) {\n String str = Base64.encodeToString((name + \":\" + password).getBytes(), Base64.NO_WRAP);\n return \"Basic \" + str;\n }", "class_method_signature": "NetUtil.getBasicHeader(String name, String password)", "constructo...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 68459222, "size": 385, "stargazer_count": 46, "stars": null, "updates": null, "url": "https://github.com/kobakei/Anago" }
68459222_1
{ "fields": [ { "declarator": "authTokenRepository", "modifier": "", "original_string": "AuthTokenRepository authTokenRepository;", "type": "AuthTokenRepository", "var_name": "authTokenRepository" } ], "file": "app/src/test/java/io/github/kobakei/anago/repository/AuthTokenRep...
{ "body": "@Test\n public void getOrCreate_isSuccess() {\n String name = \"user\";\n String password = \"password\";\n AuthToken authToken = authTokenRepository.getOrCreate(name, password)\n .toBlocking()\n .value();\n Assert.assertEquals(\"token\", authTok...
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private Context context;", "type": "Context", "var_name": "context" }, { "declarator": "gitHubApiClient", "modifier": "private final", "original_string": "private final GitHu...
{ "body": "public Single<AuthToken> getOrCreate(String name, String password) {\n String header = NetUtil.getBasicHeader(name, password);\n String clientId = context.getString(R.string.github_client_id);\n String fingerprint = UUID.randomUUID().toString();\n AuthorizationBody body = new Au...
{ "created": null, "fork": null, "fork_count": 5, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 68459222, "size": 385, "stargazer_count": 46, "stars": null, "updates": null, "url": "https://github.com/kobakei/Anago" }
72436214_27
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private LabelService underTest;", "type": "LabelService", "var_name": "underTest" }, { "declarator": "wardService", "modifier": "private", "original_string": "private WardS...
{ "body": "@Test\n public void generatesTheAddressLabels() throws Exception {\n String wardCode = \"E05000403\";\n String wardName = \"Canbury\";\n String constituencyName = \"Richmond Park\";\n User user = user().build();\n ArgumentCaptor<GeneratePdfRequest> pdfRequestCaptor = A...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(LabelService.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(LabelService.class);", "type": "Logger", "var_name": "log" }, { "declarator": "wardServ...
{ "body": "public Try<byte[]> generateAddressLabelsForPostalVoters(ElectorsByStreetsRequest request,\n String wardCode,\n User user) {\n return wardService.getByCode(wardCode, user)\n ...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_31
{ "fields": [ { "declarator": "constituencyRepository", "modifier": "private", "original_string": "private ConstituencyRepository constituencyRepository;", "type": "ConstituencyRepository", "var_name": "constituencyRepository" }, { "declarator": "underTest", "modi...
{ "body": "@Test\n public void returnsNotAuthorizedIfNonAdminWhenAssociateConstituencyToUser() throws Exception {\n User admin = user().withRole(Role.USER).build();\n User user = user().withConstituencies(new HashSet<>()).build();\n Constituency constituency = constituency().build();\n ...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConstituencyAssociationService.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(ConstituencyAssociationService.class);", "type": "Logger", "var_name": "log" },...
{ "body": "@Transactional\n public Try<User> associateToUser(User permissible, UUID constituencyID, UUID userID) {\n if (!permissible.isAdmin()) {\n log.error(\"Non admin attempted to associate user={} to constituency={}. loggedInUser={}\", userID, constituencyID, permissible);\n retur...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_66
{ "fields": [ { "declarator": "underTest = new RestErrorHandler()", "modifier": "private", "original_string": "private RestErrorHandler underTest = new RestErrorHandler();", "type": "RestErrorHandler", "var_name": "underTest" } ], "file": "web-server/src/test/java/com/infinit...
{ "body": "@Test\n public void mapsPafApiNotFoundFailure() throws Exception {\n ResponseEntity<?> responseEntity = underTest.mapToResponseEntity(new PafApiNotFoundFailure(\"failure\"));\n\n assertThat(responseEntity, hasStatusCode(equalTo(404)));\n }", "class_method_signature": "RestErrorHandler...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RestErrorHandler.class)", "modifier": "private static final", "original_string": "private static final Logger log = LoggerFactory.getLogger(RestErrorHandler.class);", "type": "Logger", "var_name": "log" }, { "...
{ "body": "public ResponseEntity<?> mapToResponseEntity(Exception exception) {\n HttpHeaders headers = new HttpHeaders();\n headers.setContentType(MediaType.APPLICATION_JSON);\n return mapToResponseEntity(exception, headers);\n }", "class_method_signature": "RestErrorHandler.mapToResponseEnt...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_11
{ "fields": [ { "declarator": "underTest = new TemplateRenderer()", "modifier": "private", "original_string": "private TemplateRenderer underTest = new TemplateRenderer();", "type": "TemplateRenderer", "var_name": "underTest" } ], "file": "web-server/src/test/java/com/infinit...
{ "body": "@Test\n public void rendersTheTemplate() throws Exception {\n String template = \"<html>Username: %s<br>Password: %s</html>\";\n Object[] replacementParams = new Object[] {\"someUser\", \"somePassword\"};\n\n String result = underTest.render(template, replacementParams);\n\n ...
{ "fields": [], "file": "web-server/src/main/java/com/infinityworks/webapp/notifications/TemplateRenderer.java", "identifier": "TemplateRenderer", "interfaces": "", "methods": [ { "class_method_signature": "TemplateRenderer.render(String template, Object... replacementParameters)", "constructo...
{ "body": "public String render(String template, Object... replacementParameters) {\n return String.format(template, replacementParameters);\n }", "class_method_signature": "TemplateRenderer.render(String template, Object... replacementParameters)", "constructor": false, "full_signature": "public Stri...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_46
{ "fields": [ { "declarator": "constituencyRepository", "modifier": "private", "original_string": "private ConstituencyRepository constituencyRepository;", "type": "ConstituencyRepository", "var_name": "constituencyRepository" }, { "declarator": "underTest", "modi...
{ "body": "@Test\n public void returnsTheRestrictedConstituenciesForUser() throws Exception {\n Constituency rugby = constituency().withName(\"Rugby\").build();\n Constituency covSouth = constituency().withName(\"Coventry South\").build();\n Ward henley = ward().withWardName(\"Henley\").withCo...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConstituencyService.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(ConstituencyService.class);", "type": "Logger", "var_name": "log" }, { "declarat...
{ "body": "public UserRestrictedConstituencies getVisibleConstituenciesByUserWithWardContext(User user) {\n Set<Constituency> wardConstituencies = user.getWards()\n .stream()\n .map(Ward::getConstituency)\n .collect(toSet());\n\n wardConstituencies.addAll(use...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_0
{ "fields": [], "file": "common/src/test/java/com/infinityworks/common/lang/StringExtrasTest.java", "identifier": "StringExtrasTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void returnsFalseIfNull() throws Exception {\n assertThat(StringExtras.isNullOrEmpty(null), is(true));\n }", "class_method_signature": "StringExtrasTest.returnsFalseIfNull()", "constructor": false, "full_signature": "@Test public void returnsFalseIfNull()", "identifier":...
{ "fields": [], "file": "common/src/main/java/com/infinityworks/common/lang/StringExtras.java", "identifier": "StringExtras", "interfaces": "", "methods": [ { "class_method_signature": "StringExtras.isNullOrEmpty(String underTest)", "constructor": false, "full_signature": "public static ...
{ "body": "public static boolean isNullOrEmpty(String underTest) {\n return underTest == null || underTest.isEmpty();\n }", "class_method_signature": "StringExtras.isNullOrEmpty(String underTest)", "constructor": false, "full_signature": "public static boolean isNullOrEmpty(String underTest)", "iden...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_50
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private ResetPasswordTokenExpirationCheck underTest;", "type": "ResetPasswordTokenExpirationCheck", "var_name": "underTest" }, { "declarator": "removeTokenService", "modifier": "...
{ "body": "@Test\n public void removesTheExpiredPasswordToken() throws Exception {\n given(removeTokenService.removeExpiredTokens()).willReturn(3L);\n\n underTest.removeExpiredTokens();\n\n verify(removeTokenService, times(1)).removeExpiredTokens();\n }", "class_method_signature": "ResetP...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ResetPasswordTokenExpirationCheck.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(ResetPasswordTokenExpirationCheck.class);", "type": "Logger", "var_name": "log" ...
{ "body": "@Scheduled(fixedDelayString = \"${canvass.passwordTokenExpiryDeletedUpdateInterval}\")\n public void removeExpiredTokens() {\n long numDeleted = tokenRemovalService.removeExpiredTokens();\n if (numDeleted > 0) {\n log.info(String.format(\"Removed %s expired reset password tokens...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_51
{ "fields": [ { "declarator": "underTest = new PasswordGenerator()", "modifier": "private final", "original_string": "private final PasswordGenerator underTest = new PasswordGenerator();", "type": "PasswordGenerator", "var_name": "underTest" } ], "file": "web-server/src/test/...
{ "body": "@Test\n public void generatesARandomPassword() throws Exception {\n String password = underTest.get();\n\n assertThat(password, instanceOf(String.class));\n assertThat(password.length(), greaterThanOrEqualTo(18));\n }", "class_method_signature": "PasswordGeneratorTest.generates...
{ "fields": [ { "declarator": "PASSWORD_LENGTH = 18", "modifier": "private static final", "original_string": "private static final int PASSWORD_LENGTH = 18;", "type": "int", "var_name": "PASSWORD_LENGTH" } ], "file": "web-server/src/main/java/com/infinityworks/webapp/security...
{ "body": "@Override\n public String get() {\n return RandomStringUtils.randomAlphanumeric(PASSWORD_LENGTH);\n }", "class_method_signature": "PasswordGenerator.get()", "constructor": false, "full_signature": "@Override public String get()", "identifier": "get", "invocations": [ "randomAlpha...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_1
{ "fields": [], "file": "common/src/test/java/com/infinityworks/common/lang/StringExtrasTest.java", "identifier": "StringExtrasTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void returnsFalseIfEmpty() throws Exception {\n assertThat(StringExtras.isNullOrEmpty(\"\"), is(true));\n }", "class_method_signature": "StringExtrasTest.returnsFalseIfEmpty()", "constructor": false, "full_signature": "@Test public void returnsFalseIfEmpty()", "identifie...
{ "fields": [], "file": "common/src/main/java/com/infinityworks/common/lang/StringExtras.java", "identifier": "StringExtras", "interfaces": "", "methods": [ { "class_method_signature": "StringExtras.isNullOrEmpty(String underTest)", "constructor": false, "full_signature": "public static ...
{ "body": "public static boolean isNullOrEmpty(String underTest) {\n return underTest == null || underTest.isEmpty();\n }", "class_method_signature": "StringExtras.isNullOrEmpty(String underTest)", "constructor": false, "full_signature": "public static boolean isNullOrEmpty(String underTest)", "iden...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_47
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private PasswordResetService underTest;", "type": "PasswordResetService", "var_name": "underTest" }, { "declarator": "passwordGenerator", "modifier": "private", "original_s...
{ "body": "@Test\n public void generatesANewRandomUserPassword() throws Exception {\n User user = user().build();\n given(passwordGenerator.get()).willReturn(\"somepassword\");\n\n GeneratePasswordResetResponse password = underTest.resetPassword(user);\n\n assertThat(password.password()...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(PasswordResetService.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(PasswordResetService.class);", "type": "Logger", "var_name": "log" }, { "declar...
{ "body": "@Transactional\n GeneratePasswordResetResponse resetPassword(User user) {\n log.info(\"Generating new password for user={}. User performed self-reset via password reset loop\", user);\n\n String newPassword = passwordGenerator.get();\n String passwordHash = passwordEncoder.encode(ne...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_10
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private NewAccountNotifier underTest;", "type": "NewAccountNotifier", "var_name": "underTest" }, { "declarator": "emailClient", "modifier": "private", "original_string": "p...
{ "body": "@Test\n public void sendsTheAccountNotification() throws Exception {\n ArgumentCaptor<EmailMessage> emailContentCaptor = ArgumentCaptor.forClass(EmailMessage.class);\n given(emailClient.sendEmail(emailContentCaptor.capture())).willReturn(success(ImmutableEmailResponse.builder().withMessage...
{ "fields": [ { "declarator": "emailClient", "modifier": "private final", "original_string": "private final EmailClient emailClient;", "type": "EmailClient", "var_name": "emailClient" }, { "declarator": "templateRenderer", "modifier": "private final", "origi...
{ "body": "@Async\n public void sendAccountCreationInformation(User user, String password) {\n if (messageTemplate != null) {\n String emailContent = templateRenderer.render(messageTemplate, user.getUsername(), password);\n EmailMessage message = ImmutableEmailMessage.builder()\n ...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_67
{ "fields": [], "file": "web-server/src/test/java/com/infinityworks/webapp/domain/ErnTest.java", "identifier": "ErnTest", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected = IllegalArgumentException.class)\n public void failsIfInvalid() throws Exception {\n Ern.valueOf(\"1234-11-44\");\n }", "class_method_signature": "ErnTest.failsIfInvalid()", "constructor": false, "full_signature": "@Test(expected = IllegalArgumentException.class) public v...
{ "fields": [ { "declarator": "REGEX = \"^\\\\w{1,10}-\\\\w{1,8}-\\\\d{1,8}-\\\\w{1,3}$\"", "modifier": "public static final", "original_string": "public static final String REGEX = \"^\\\\w{1,10}-\\\\w{1,8}-\\\\d{1,8}-\\\\w{1,3}$\";", "type": "String", "var_name": "REGEX" }, ...
{ "body": "public static Ern valueOf(String value) {\n if (!value.matches(REGEX)) {\n throw new IllegalArgumentException(\"Invalid ERN format\");\n } else {\n String[] parts = value.split(\"-\");\n return new Ern(parts[0], parts[1], parts[2], parts[3]);\n }\n }...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_30
{ "fields": [ { "declarator": "constituencyRepository", "modifier": "private", "original_string": "private ConstituencyRepository constituencyRepository;", "type": "ConstituencyRepository", "var_name": "constituencyRepository" }, { "declarator": "underTest", "modi...
{ "body": "@Test\n public void returnsNotFoundIfConstituencyNotFoundWhenAssociateConstituencyToUser() throws Exception {\n User admin = user().withRole(Role.ADMIN).build();\n User user = user().withConstituencies(new HashSet<>()).build();\n Constituency constituency = constituency().build();\n...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(ConstituencyAssociationService.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(ConstituencyAssociationService.class);", "type": "Logger", "var_name": "log" },...
{ "body": "@Transactional\n public Try<User> associateToUser(User permissible, UUID constituencyID, UUID userID) {\n if (!permissible.isAdmin()) {\n log.error(\"Non admin attempted to associate user={} to constituency={}. loggedInUser={}\", userID, constituencyID, permissible);\n retur...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_26
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private AddressService underTest;", "type": "AddressService", "var_name": "underTest" }, { "declarator": "wardService", "modifier": "private", "original_string": "private W...
{ "body": "@Test\n public void shouldRemoveTheStreetsIfStreetContainsNoVoters() throws Exception {\n User u = user().build();\n String wardCode = \"E0911135\";\n given(wardService.getByCode(wardCode, u)).willReturn(Try.success(ward().withWardCode(wardCode).build()));\n given(pafAddressS...
{ "fields": [ { "declarator": "wardService", "modifier": "private final", "original_string": "private final WardService wardService;", "type": "WardService", "var_name": "wardService" }, { "declarator": "pafAddressService", "modifier": "private final", "orig...
{ "body": "public Try<StreetsByWardResponse> getTownStreetsByWardCode(String wardCode, User user) {\n return wardService\n .getByCode(wardCode, user)\n .flatMap(ward -> pafAddressService.getStreetsByWard(ward.getCode()));\n }", "class_method_signature": "AddressService.getTow...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_17
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private MapsRequestExecutor underTest;", "type": "MapsRequestExecutor", "var_name": "underTest" } ], "file": "web-server/src/test/java/com/infinityworks/webapp/clients/gmaps/MapsRequestExecu...
{ "body": "@Test\n public void returnsAWrappedMapsApiNotFoundFailureIfTheRequestReturnsNotFound() throws Exception {\n CallStub<String> request = CallStub.notFound();\n\n Try<String> response = underTest.execute(request);\n\n assertThat(response.isFailure(), is(true));\n assertThat(resp...
{ "fields": [ { "declarator": "FORMAT = \"Error calling Maps API %s. Response contained status code=%d, status text=%s\"", "modifier": "private static final", "original_string": "private static final String FORMAT = \"Error calling Maps API %s. Response contained status code=%d, status text=%s\"...
{ "body": "public <T> Try<T> execute(Call<T> call) {\n try {\n Response<T> response = call.execute();\n if (response.isSuccessful()) {\n T body = response.body();\n return Try.success(body);\n } else {\n return handleUnsuccessful(cal...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_40
{ "fields": [ { "declarator": "underTest", "modifier": "private", "original_string": "private RecordVotedService underTest;", "type": "RecordVotedService", "var_name": "underTest" }, { "declarator": "pafClient", "modifier": "private", "original_string": "pri...
{ "body": "@Test\n public void recordsAVote() throws Exception {\n User user = user().withWriteAccess(true).build();\n Ern recordVote = Ern.valueOf(\"E05001221-PD-123-1\");\n Ward ward = ward().withWardCode(\"E05001221\").build();\n Call<RecordVotedResponse> call = CallStub.success(Immu...
{ "fields": [ { "declarator": "log = LoggerFactory.getLogger(RecordVotedService.class)", "modifier": "private final", "original_string": "private final Logger log = LoggerFactory.getLogger(RecordVotedService.class);", "type": "Logger", "var_name": "log" }, { "declarator...
{ "body": "public Try<RecordVoteResponse> recordVote(User user, Ern ern) {\n return user\n .ensureWriteAccess()\n .flatMap(resolvedUser -> wardService.getByCode(ern.getWardCode(), user)\n .flatMap(ward -> {\n Call<RecordVotedRespon...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }
72436214_6
{ "fields": [], "file": "common/src/test/java/com/infinityworks/common/lang/ListExtrasTest.java", "identifier": "ListExtrasTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void noneNullReturnsTrueIfEmptyList() throws Exception {\n List<Integer> data = emptyList();\n\n boolean isValid = ListExtras.noneNull(data);\n\n assertThat(isValid, is(true));\n }", "class_method_signature": "ListExtrasTest.noneNullReturnsTrueIfEmptyList()", "...
{ "fields": [], "file": "common/src/main/java/com/infinityworks/common/lang/ListExtras.java", "identifier": "ListExtras", "interfaces": "", "methods": [ { "class_method_signature": "ListExtras.isNullOrEmpty(List<?> underTest)", "constructor": false, "full_signature": "public static boole...
{ "body": "public static boolean noneNull(Collection<?> underTest) {\n return underTest != null && underTest.stream().allMatch(o -> o != null);\n }", "class_method_signature": "ListExtras.noneNull(Collection<?> underTest)", "constructor": false, "full_signature": "public static boolean noneNull(Collec...
{ "created": null, "fork": null, "fork_count": 39, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 72436214, "size": 3406, "stargazer_count": 83, "stars": null, "updates": null, "url": "https://github.com/celestial-winter/vics" }