NEMOparser implements NEMOparserConstants { static final public String DeleteOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage) throws ParseException { Token objOperationNameToken = null; DeleteOperationLang deleteOperationlang = new DeleteOperationLang(dataBroker, tenantManage); objOperationNameToken = jj_consume_token(ID); jj_consume_token(SEMICOLON); {if (true) return deleteOperationlang.DeleteOperationHandling(userId, objOperationNameToken.image);} throw new Error("Missing return statement in function"); } NEMOparser(java.io.InputStream stream);  NEMOparser(java.io.InputStream stream, String encoding);  NEMOparser(java.io.Reader stream);  NEMOparser(NEMOparserTokenManager tm); String parseNEMO(UserId userId,String strNEMO, DataBroker dataBroker, TenantManage tenantManage); static final String NEMO(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateIntent(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteIntent(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateNode(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateConnection(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateFlow(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String UpdateOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String NodeModel(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String abstractNode(UpdateTemplateDefinitionLang definition); static final String abstractConnection(UpdateTemplateDefinitionLang definition); static final String abstractFlow(UpdateTemplateDefinitionLang definition); static final String abstractOperation(UpdateTemplateDefinitionLang definition); static final String DeleteNode(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteConnection(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteFlow(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String DeleteOperation(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final String Query(UserId userId, DataBroker dataBroker, TenantManage tenantManage); static final LinkedHashMap<String,String> conditionTarget(); static final LinkedHashMap<String,String> property(); static final LinkedHashMap<String,String> nodeMultiProperty(); static void ReInit(java.io.InputStream stream); static void ReInit(java.io.InputStream stream, String encoding); static void ReInit(java.io.Reader stream); void ReInit(NEMOparserTokenManager tm); static final Token getNextToken(); static final Token getToken(int index); static ParseException generateParseException(); static final void enable_tracing(); static final void disable_tracing(); static public NEMOparserTokenManager token_source; static public Token token; static public Token jj_nt; }
@Test public void testDeleteOperation() throws Exception { UserId userId = mock(UserId.class); DataBroker dataBroker = mock(DataBroker.class); TenantManage tenantManage = mock(TenantManage.class); Field field_token = class1.getDeclaredField("token"); field_token.setAccessible(true); Token token1 = new Token(); Token token2 = new Token(); Token token3 = new Token(); token1.next = token2; token1.kind = token2.kind = 56; token1.image = token2.image = token3.image = "test"; token3.kind = 7; field_token.set(class1, token1); PowerMockito.mockStatic(NEMOparserTokenManager.class); PowerMockito.when(NEMOparserTokenManager.getNextToken()).thenReturn(token3); when(tenantManage.getObjectId(userId,"test")).thenReturn(null); Assert.assertTrue(NEMOparser.DeleteOperation(userId, dataBroker, tenantManage).equals("The operation " + "test" + " is not exist.")); }